dynamic button in jsp

Posted by kawtousse on Stack Overflow See other posts from Stack Overflow or by kawtousse
Published on 2010-06-01T09:21:27Z Indexed on 2010/06/01 9:23 UTC
Read the original article Hit count: 292

Filed under:
|
|

hi everyone, in my jsp i have a table constructed dynamically like the following:

retour.append("<tr>");

            try {

s= HibernateUtil.currentSession(); tx=s.beginTransaction(); Query query = s.createQuery(HQL_QUERY);

 for(Iterator it=query.iterate();it.hasNext();)
 {                                                                           
                   if(it.hasNext()){

                       Dailytimesheet object=(Dailytimesheet)it.next();                        
                       retour.append("<td>" +object.getActivity() +"</td>");
                       retour.append("<td>" +object.getProjectCode() + "</td>");
                       retour.append("<td>"  +object.getWAName() +  "</td>");
                       retour.append("<td>"  +object.getTaskCode() +"</td>");
                       retour.append("<td>"  +object.getTimeFrom() +"</td>");
                       retour.append("<td>" +object.getTimeSpent() + "</td>");
                       retour.append("<td>" +object.getPercentTaskComplete() + "</td>");
                       if (droitdaccess)
                       {

retour.append(""); retour.append(""); retour.append("");

                       retour.append("<td  bordercolor=#FFFFFF>");
                       retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\"  value=\""+object.getIdDailyTimeSheet()+"\"/>");
                       retour.append("<img src=\"icon_delete.gif\" onClick=\"deletearowById('id_"+nomTab+"_"+compteur+"')\" style=\"cursor:pointer\"  name=\"action\"  value=\"deleting\" />");
                       retour.append("</td>");

                       }
                       }

                       compteur++;    
                       retour.append("</tr>");


 }   

//terminer la table.

retour.append ("</table>");

next to the table i want to display a button named send in order to send the table content. I do not really want to dispaly this button where the table is empty.

So at least if the table is populated by nly one record i want that button being displayed. How should i deal in this case.

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about html