Hello, it is possible to have one form by tab??? Because i would like to validate tab by tab. With just one form for all the tabview --> i validate the first tab , the second tab is also validate...
Thank's
multiple <h:form> for one tabview
Yes I also noticed this problem.
Solution 1:
Set <p:tabView dynamic="false" >
Now all your tabs are loaded, switching is done only by JS and your <p:tabView> doesn't need to be surrounded by a form element.
Solution 2:
Use Ajax to validate your input fields. Just update the necessary elements with ajax and there is no need to submit a complete form
Solution 1:
Set <p:tabView dynamic="false" >
Now all your tabs are loaded, switching is done only by JS and your <p:tabView> doesn't need to be surrounded by a form element.
Solution 2:
Use Ajax to validate your input fields. Just update the necessary elements with ajax and there is no need to submit a complete form
PrimeFaces 3.0, Glassfish 3.1.2, Mojarra 2.1.6,
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Can you post your code?
Here ma code:
<h:form>
<p:tabView dynamic="true" cache="false" activeIndex="#{tabManager.activeIndex}" >
<p:tab title="Employeur - Travailleur" id="firstTab" >
<ui:include src="./tab1.xhtml"/>
</p:tab>
<p:tab title="Occupation" id="secondTab" >
<ui:include src="./tab2.xhtml"/>
</p:tab>
<p:tab title="Summary" id="ThirdTab" >
<ui:include src="./tab3.xhtml"/>
</p:tab>
</p:tabView>
</h:form>
These 3 tabs share a managed bean called "article" with just properties like ( (name and description on first tab, price and quantity on second tab...).
The scenario is --> i'am on the first tab --> i go to the second tab without validate the first --> i'm back to the first then i valide and i receive error messages from data inside first tab(logic) but also error messages from second tab.. (problem).
my actions business is found in the article managedbean and i access via EL.
I hope that you can help me. Thank's
<h:form>
<p:tabView dynamic="true" cache="false" activeIndex="#{tabManager.activeIndex}" >
<p:tab title="Employeur - Travailleur" id="firstTab" >
<ui:include src="./tab1.xhtml"/>
</p:tab>
<p:tab title="Occupation" id="secondTab" >
<ui:include src="./tab2.xhtml"/>
</p:tab>
<p:tab title="Summary" id="ThirdTab" >
<ui:include src="./tab3.xhtml"/>
</p:tab>
</p:tabView>
</h:form>
These 3 tabs share a managed bean called "article" with just properties like ( (name and description on first tab, price and quantity on second tab...).
The scenario is --> i'am on the first tab --> i go to the second tab without validate the first --> i'm back to the first then i valide and i receive error messages from data inside first tab(logic) but also error messages from second tab.. (problem).
my actions business is found in the article managedbean and i access via EL.
I hope that you can help me. Thank's
-
- Posts: 24
- Joined: 29 Jan 2010, 16:27
- Location: Newbury,United Kingdom
Have you tried the Wizard(p:wizard) component?
Cheers,
Goutham
Cheers,
Goutham
Primefaces 2.2.1
GlassFish V3.0, JSF 2.0.3
EJB 3.1,HIbernate 3.5
Coding on Netbeans 6.9.1
GlassFish V3.0, JSF 2.0.3
EJB 3.1,HIbernate 3.5
Coding on Netbeans 6.9.1
No because the requirements for my webapp is
- The user can back to the first tab when he is on the fourth tab. (no back button back to the third tab then the second for finally arrive in the first tab).
- And the user can known how many tabs he must to fill before arrive to the end.
The tabview seems to be the best solution for that but...
Thank's
- The user can back to the first tab when he is on the fourth tab. (no back button back to the third tab then the second for finally arrive in the first tab).
- And the user can known how many tabs he must to fill before arrive to the end.
The tabview seems to be the best solution for that but...
Thank's
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
You can implement this with tabview as well.
Tabview has client side api like selectTab to show a tab so on client side depending on outcome from server you can switch between tabs. If you need to use dynamic tabs, a form should encapsulate the tabview and tabs should not have forms. In non-dynamic table this will not matter.
Also you would need partial processing as you want to process only current tab and ignore other tab contents.
Tabview has client side api like selectTab to show a tab so on client side depending on outcome from server you can switch between tabs. If you need to use dynamic tabs, a form should encapsulate the tabview and tabs should not have forms. In non-dynamic table this will not matter.
Also you would need partial processing as you want to process only current tab and ignore other tab contents.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Partial processing is used with ajax yes, glad you found your solution.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 17 guests