• 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

Create form based in database specifications

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone! I`ve been searching about this for some time now, I have some database specifications of components to be created in a view, and I have to create it from backing bean to the view.

1. Customer can create a form template in my tool (that is done), it can create select box, select list, radio button, insert image and insert textbox/textarea. When the costumer saves this template, I am saving the specifications of this form, such as type, position order, length, etc.
2. Now the other costumers must fill this form, but it will be loaded according to this saved template, this is where I am loosing myself, I can programatically create them in the view from the view, but i don`t know how to create it directly from the managed bean, since I'll have to loop through these elements and insert it into groups (accordions).

Any help/tips/links will be very appreciated :D
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what you are trying to do is loading up a page from the database that "describes" a GUI form of some sort?
 
Saloon Keeper
Posts: 27763
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
This sort of approach is not easily done in basic JSF. JSF is mostly for the support of pre-defined forms that are mostly static.

However, if my memory serves, the IceFaces JSF extension tagset has something intended to do what you are asking.
 
Andre Froes
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, thanks for the reply. I know it is not easily done, I have a solution (kind of) that is not based in jsf, but that is not something that i would intend to do, just in last case, i mean, it is to create a form in jquery in the backing bean and then paste it to a given id in the view. To get the values in the backing bean or to send it there, i would bind a value to a hidden element and then get from managed beam from a simple submit click by javascript.

But as I said, that is in last case, if i find a better solution in jsf i will go with it. I'm doing a hard search here for a how to in jsf but there aren't many :D, that bad lol
Thanks anyway. ;]
 
Tim Holloway
Saloon Keeper
Posts: 27763
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
Creating/modifying a JSF View's components using JavaScript is a very tricky thing to do. However, if you just need stuff like that for a single page, you can forgo JSF and use jQuery to build up a vanilla JSP that way.

Since JSF session-scope beans are exactly the same thing as ordinary J2EE session-scope beans (except that JSF builds them automatically), you can use session objects to pass data to/from the JSP to the JSF parts of the app.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic