TabView inside form?

UI Components for JSF
Post Reply
User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

14 Jan 2010, 19:28

Hi,

I have one question regarding to p:tabView. Shall it be inside h:form or not? I have the code below, but the problem is that I use nested layout inside <ui:include src="/views/#{tab.view}.xhtml"/>. According to jQuery Layout reference a form must not enclose any layout. It can be enclosed by layout unit, but not enclose layout itself.

Code: Select all

<h:body>
	<ui:insert name="resources"/>
	<p:layout id="masterLayout" fullPage="true">
		<p:layoutUnit id="masterLayoutCenter" position="center">
			<ui:insert name="header"/>
			<h:form id="mainNavigationForm">
				<p:tabView id="mainNavigationTabView" toggleMode="async" cache="false">
					<c:forEach items="#{mainNavigation.tabs}" var="tab">
						<p:tab title="#{tab.title}">
							<ui:include src="/views/#{tab.view}.xhtml"/>
						</p:tab>
					</c:forEach>
				</p:tabView>
			</h:form>
		</p:layoutUnit>
		<p:layoutUnit id="masterLayoutFooter" position="south" resizable="false" size="23">
			<ui:insert name="footer"/>
		</p:layoutUnit>
	</p:layout>
</h:body>
Or did I wrong understand following predication from http://layout.jquery-dev.net/documentat ... erminology ?
The pane elements must be direct 'children' of the container element - i.e., not nested inside other elements. There is an exception for nesting inside a FORM, or if you use an ID as a selector instead of the default class-selectors.
Thanks.
Oleg.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

15 Jan 2010, 10:36

The first post is clear for me now. The sentence says that p:layoutUnit should reside directly after p:layout (in our terms). I misunderstand this predication primarily.

The question with TabView inside the form stays open. Is it a must-have?

The other question is what does get processed if user clicks on one tab? I assume toggleMode="async" cache="false". Will be the current tab complete processed and goes through JSF lifecycle? I don't need processing at all, only rendering the clicked tab. Is it ensured?

Thanks for your help.
Oleg.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

15 Jan 2010, 16:25

TabView will get a process attribute to be used in ajax toggling case, that'll give the power to page author decide what to process. This will be done along with;

http://code.google.com/p/primefaces/iss ... ail?id=440
The question with TabView inside the form stays open. Is it a must-have?
I didn't quite understand this.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

15 Jan 2010, 22:48

Hello Cagatay,

The above-mentioned issue is important for me as well. I have ajax notcached tree in ajax notcached tabview.

My questions were
1. Should p:tabview be inside of h:form? I think yes, right?
2. What is processed by p:tabview if user click on other tab (in 2.0.0-SNAPSHOT)? The surrounded form, the current tab or none?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

18 Jan 2010, 14:57

TabView is being refactored nowadays, I haven't touched it over 6+ months so component needs some improvements. For ajax tabview, it needs to be enclosed in a form yes.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 54 guests