Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically Generate the JSP Components

 
Rushi Desai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need to generate the number of textbox,listbox and button dynamically based on user selection. Means Suppose user has select number 3 then in next page 3 text box, 3 list box and 3 button should be displayed.

I also want to retrive the values into the box.

I am using Struts 1.2. Please help me to do this.

Thanks in advance.

 
Joe Ess
Bartender
Posts: 9300
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a job for indexed properties
 
Rushi Desai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thank for reply.

Can you please explain in detail? I am new to the indexed properties.

I also want to map the values entered into the listbox.

Suppose user has select 3 values(eg. phoneno,city,state) , then three textbox should be displayed.

Now I want to map the values. Means Value entered into first textbox is of phoneno,in second box is of city and in third box is of state.
 
Joe Ess
Bartender
Posts: 9300
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the FAQ entry I linked? I think it's a pretty good introduction.
If you only have 10 or so fields of different things (name, address, phone, etc.) it may be easier to have all the fields on the JSP and conditionally display them. If it were the same kinds of things, like line items on an invoice, indexed properties may make more sense.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic