wood burning stoves*
The moose likes Struts and the fly likes Dynamically Generate the JSP Components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamically Generate the JSP Components" Watch "Dynamically Generate the JSP Components" New topic
Author

Dynamically Generate the JSP Components

Rushi Desai
Greenhorn

Joined: Jun 21, 2011
Posts: 2
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

Joined: Oct 29, 2001
Posts: 8707
    
    6

Sounds like a job for indexed properties


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Rushi Desai
Greenhorn

Joined: Jun 21, 2011
Posts: 2
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

Joined: Oct 29, 2001
Posts: 8707
    
    6

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically Generate the JSP Components
 
Similar Threads
dynamic text box
dynamically create select box
Display or not to display other controls
Crystal Report select Single(discrete) value or a Range from dynamic prompt
Unable to select single and Range parameters in Crystal 11