f:validateLength blocks menubar menuitem action.

UI Components for JSF
Post Reply
mh-hyd
Posts: 8
Joined: 05 Sep 2010, 20:34

07 Sep 2010, 20:05

Hi, I had posted a problem previously, it was as a smaller one, just to get me used to this forum and Prime Faces support ecosystem.

My second problem is this:

I have a menubar (menuBar.xhtml) as a composite component. I call it from a newUser (newUser.xhtml) page.

The newUser page has a panelGrid with inputText and inputSecret fields. If this panelGrid's inputText and inputSecret fields have f:validateLength tags, then the Logout menuitem in menubar (logout action) does not work.

How do I get around this?

Code: Select all

menuBar.xhtml
--------------

	<h:body>
		<cc:interface>
		</cc:interface>
		<cc:implementation>
			<hr/>
			<p:menubar>
				<p:submenu>
					<f:facet name="label">
						<p:menuitem value="Logout" action="#{logoutBean.logout}"/>
					</f:facet>
				</p:submenu>
				
			</p:menubar>
			<hr/>
		</cc:implementation> 
	</h:body>

newUser.xhtml
------------
<h:body>
	<h:form>
		<r:menuBar/>
		<h:panelGrid columns="3" border="0" cellpadding="5" cellspacing="3" headerClass="login-heading">
		<f:facet name="header">
			<h:outputText value="Create User" />
		</f:facet>
		<h:messages globalOnly="true" styleClass="errors"/>
		<h:panelGroup/>
		<h:panelGroup/>
		
		<h:outputLabel for="useridInput">
			<h:outputText value="Id : "/>
		</h:outputLabel>
		<h:inputText id="useridInput" size="20" maxlength="30" value="#{newUserBkBean.id}">
			<!-- <f:validateLength minimum="5" maximum="30"/> -->
		</h:inputText>
		<!-- <h:message for="useridInput"/> -->
If I remove the comments around f:validateLength and h:message, then menuBar's logoutBean.logout does not work.

Thanks
-- MH

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

07 Sep 2010, 22:02

Try partial processing;

Code: Select all

<p:menuitem value="Logout" action="#{logoutBean.logout}" process="@this"/>

mh-hyd
Posts: 8
Joined: 05 Sep 2010, 20:34

13 Sep 2010, 18:52

Hi,

That worked and solved my problem. Many thanks.

Can you point me to where I can find information about partial processing?

-- MH

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

18 Sep 2010, 14:40

User's Guide should have info about it at PPR section.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 58 guests