Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Q:Dynamically add form elements in JSF

843842Aug 29 2005 — edited Feb 20 2008
I am planning to develop an application using JSF but I don't know how to solve a problem using JSF. I know Java and JSP rathe good, but JSF is rather new for me.

I am developing a system where I want to have pages with different input components displayed inside the form element depending on who logs in. There will be a considerate number of users and I m going to store/configure the form fields in the database for the different users.
I know this sound strange but my requirement/solution is that the forms should be dynamic and user dependent.
I am planning to JSF as I like to validation, converters and extensibility of the framework so I actually want to use the

I.e. one user could have the fields
<ui:textField .../>
<ui:checkbox ../>
<ui:checkbox ../>
<ui:textField .../>
<ui:button .../>

while another could have this set
<ui:checkbox ../>
<ui:textField .../>
<ui:checkbox ../>
<ui:button />

The different forms are not sub-set of each other so it is not possible to just hide them using for example the "rendered" attribute. I also want to uset the validation tags inside the input elements and I don't want to generate a lot of JSF pages on the fly.

Is this possible to do this in an easy way using JSF?

- Kenneth Ljunggren
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 19 2008
Added on Aug 29 2005
19 comments
3,296 views