• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

best way to display multiple pages with almost similar fields on them??

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Friends:
I have a situation. I have to display 15-20 web pages. These web pages are forms and have almost same functionality. some pages require 5 fields while other require 8, something like that. but there are some pages that have almost same fields with a diffence of 1 or 2.

I don't want to hard code the 15-20 web pages. is there any way that we can create the web pages on the fly as per the user requirement.???
Every suggestion is appreciated
R
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have some kind of object in some scope (say request) which keeps track of these requirements. In your JSP, refer to this object and conditionally render your form fields based on the properties of that object.
The object in question might return a simple boolean for whether or not to render a particular field. For example, let's say our object is called "requirements":

Anyway, you get the idea.
HTH
[ January 07, 2003: Message edited by: Jason Menard ]
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about having a collection object to hold different sets of field names?
for eg, let us have a Map in which we store the list of fields like this :
"page1" => {"name", "password", "age" ...}
"page2" => {"name", "addr", "acc" ...}
...
Disadvantage :
* This might end up in a rigid presentation * inflexible for tuning form tags
Have fun.
Regards,
Balaji
 
Anil Jain
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks jason and jeya!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic