Hi,
I want to switch from a static form to a dynamic form.
So DynaForm seems to be perfect for that.
My problem is that the static form splits its inputs across multiple tabs (TabView)
Is it possible to do that with the dynamic solution ?
thanks in advance,
Rem
DynaForm and TabView
I am interesting in doing the same thing. My form is split in different tabs showing as an accordion. I am creating several DynaFormModel objects, one for each tab, and i assign each dynamic form field to a row in the relevant models.
I can then display my accordion like this
This works to a point, each field is rendered in the right tab. But i am seeing issues when i want to use primefaces validation on required fields (e.g. p:message ) either inline as per the example above, or the global p:messages tag.
If i add an ajax event such as 'keyup' in my input text definition , with an update attribute set to the message id, i see the inline error message when blanking the field.
My requirement is validation on submit however. With the solution described above, I see the messages on submit if only have 1 tab to render, hence 1 DynaformModel. If i have more than one model, i do not see any messages.
My current thinking is that something is getting confused with multiple <pe:dynaform id="dynaform"> tags, maybe something to do with the id ?
If anybody can advise on how to solve this, I would be grateful.
I can then display my accordion like this
Code: Select all
<p:accordionPanel multiple="true" var="formPanel" value="#{productForm.formPanels}">
<p:tab title="#{formPanel}" id="#{formPanel}">
<pe:dynaForm id="dynaform" value="#{myForm.getPanelFormModel(formPanel)}"" var="data" >
<pe:dynaFormControl type="input" for="txt" >
<p:inputText id="txt" value="#{data.value}" required="#{data.required}" />
<p:message id="txtErrorMessage" for="txt" />
</pe:dynaFormControl>
</pe:dynaForm>
</p:tab>
</p:accordionPanel>
If i add an ajax event such as 'keyup' in my input text definition , with an update attribute set to the message id, i see the inline error message when blanking the field.
My requirement is validation on submit however. With the solution described above, I see the messages on submit if only have 1 tab to render, hence 1 DynaformModel. If i have more than one model, i do not see any messages.
My current thinking is that something is getting confused with multiple <pe:dynaform id="dynaform"> tags, maybe something to do with the id ?
If anybody can advise on how to solve this, I would be grateful.
I am interesting in doing the same thing. My form is split in different tabs showing as an accordion. I am creating several DynaFormModel objects, one for each tab, and i assign each dynamic form field to a row in the relevant models.
I can then display my accordion like this
This works to a point, each field is rendered in the right tab. But i am seeing issues when i want to use primefaces validation on required fields (e.g. p:message ) either inline as per the example above, or the global p:messages tag.
If i add an ajax event such as 'keyup' in my input text definition , with an update attribute set to the message id, i see the inline error message when blanking the field.
My requirement is validation on submit however. With the solution described above, I see the messages on submit if only have 1 tab to render, hence 1 DynaformModel. If i have more than one model, i do not see any messages.
My current thinking is that something is getting confused with multiple <pe:dynaform id="dynaform"> tags, maybe something to do with the id ?
If anybody can advise on how to solve this, I would be grateful.
thank you.
I can then display my accordion like this
Code: Select all
<p:accordionPanel multiple="true" var="formPanel" value="#{productForm.formPanels}">
<p:tab title="#{formPanel}" id="#{formPanel}">
<pe:dynaForm id="dynaform" value="#{myForm.getPanelFormModel(formPanel)}"" var="data" >
<pe:dynaFormControl type="input" for="txt" >
<p:inputText id="txt" value="#{data.value}" required="#{data.required}" />
<p:message id="txtErrorMessage" for="txt" />
</pe:dynaFormControl>
</pe:dynaForm>
</p:tab>
</p:accordionPanel>
If i add an ajax event such as 'keyup' in my input text definition , with an update attribute set to the message id, i see the inline error message when blanking the field.
My requirement is validation on submit however. With the solution described above, I see the messages on submit if only have 1 tab to render, hence 1 DynaformModel. If i have more than one model, i do not see any messages.
My current thinking is that something is getting confused with multiple <pe:dynaform id="dynaform"> tags, maybe something to do with the id ?
If anybody can advise on how to solve this, I would be grateful.
thank you.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 4 guests