• Post Reply Bookmark Topic Watch Topic
  • New Topic

Create form based in database specifications

 
Andre Froes
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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
 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • 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?
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!