• 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

generate selectonemenu dynamically

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am working on shopping cart application in which i want to generate selectonemenu dynamically for setting Item attribute from database.
for eg, I have 4 tables item, attribute,attribute_value and mapping of this three. Now i want that I ask user to select attribute for item and than assign value.
to assign attribute to item i created checkboxlist that is working perfectly then i want that selected attribute as label and their value appear inside dropdown
i made to display but get confused when it comes to storing this value in database
confused in red underlined place....
This is without any dynamic generation but i think solution is dynamic component but dont know how
code snippets:


 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Sukruti!

We have a "Code" button on our message editor. You can use it to format structured text like Java code and XML so that it's easier to read. I've applied it to your post.

Avoid using JSTL tags like the "c:forEach". JSTL does not work well with JSF and JSF has native tags that work better.

In the case of a set of similar UI constructs of varying number arranged vertically, my first preference is the h:dataTable tag. This will layout the constructs as rows in a 2-dimensional grid.

For horizonal layout of constructs or for more free-form layouts, I'd use the ui:repeat tag.

You almost never have to create components dynamically in JSF, and especially not in cases where the size of the generator data is the sole reason, since JSF is designed to adapt the view based on the model.

An alternative for when you need complex controls not available from raw HTML (and thus not from the core JSF tagset) is to use a third-party extension tagset such as RichFaces, IceFaces, PrimeFaces or Apache Tomahawk. These extension sets generally have actual menu tags offering both horizontal and vertical menu layouts already debugged and ready to use.
 
Sukruti Patel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply i'll take care of this...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic