Win a copy of Functional Design and Architecture this week in the Functional programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Dynamically adding a row in JSP

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We are developing struts based web application. Iam getting the results from database and populating the list on the screen using dto objects.

<logic:iterate id="list"
name="DetailDto"
property="listdata"
type="examples.ListDataDto"
indexId="index1">
<%-- it has 5 columns --%>
</logic:iterate>

iam able to populate the data correctly and its working fine. I want to add one row at the end dynamically with the first column to be set as a text box.

How do i do that? Can someone help me in this?

Thanks,
Raj Chukka
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
get the size of the list in a bean variable. compare the index with the size in logic:equal tags and put your stuff in there.

Hope this helps.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


<logic:iterate id="list"
name="DetailDto"
property="listdata"
type="examples.ListDataDto"
indexId="index1">
<%-- it has 5 columns --%>
</logic:iterate>


I would suggest you to use displaytag instead of painting your own table.

I want to add one row at the end dynamically with the first column to be set as a text box.


I don't understand this part of your question. By dynamically, what is the condition for this last row to appear or not appear?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
u can use javascript to dynamically add the rows.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic