Hi guys.
This is not a MyFaces related problem, but a JSF related problem. Maybe someone here could help me. I'm writing a set of components for a new web application based on JSF. Among requisites there is the need to build some forms in a dynamic way: the application will sell products that will change in the future, and the request from our committee is that (only for some product) forms are to be auto-generated from a xml structure (or something similar) that can be built using product info stored into the database. Now my problem is this: I have created a jsf components that reads the xml and creates new inputs components using validations and conversions directly from the passed informations (using Shale and its validator tags I can add javascript validation too!). It's great, but I don't think it's the right approach to the problem, because I'm creating new components dynamically during the rendering phase of my component and I have to make them not transient to allow the lifecycle to be applied to my fresh created components. So, when the page is reloaded for some reason, I get a duplicate id error, 'cause I'm adding components in the view that I've already added before. I can check in some way if I have to add or not my new inputs, but for reasons I can't explain, it is not always possible for me to do this check. Where I'm wrong with this problem? Is my solution totally wrong or is there a way to safely add not transient components to my view without the duplicate id problem?

Thanks.

Regards,
Pierpaolo

--
Pierpaolo Follia
Wave S.r.l. - Vai Benaco 24/B, Bedizzole (BS)
Telefono: +39 030 687561
Fax: +39 030 6875690

Reply via email to