<p:commandButton> action not firing

UI Components for JSF
Post Reply
oidsman
Posts: 26
Joined: 07 Sep 2010, 21:26

11 Feb 2011, 13:55

have a very simple form with some buttons being used for navigation. With ajax="false" the action sfire and work but using ajax the next page doesn't appear but the backing bean action is being called. For example in form below doCustomerEntry gets called but page doesn't navigate to next page.

The form looks as follows:-

Code: Select all

<h:form>
				<h:panelGrid columns="2">
					<p:commandButton value="#{pageText.page_home_link_new}"
						action="#{homeBean.doCustomerEntry}"  />
					<h:outputText value="#{pageText.page_home_link_new_details}" />
					<p:commandButton value="#{pageText.page_home_link_search}"
						action="search"  />
					<h:outputText value="#{pageText.page_home_link_search_detail}" />
					<p:commandButton
						value="#{pageText.page_home_link_historical_cancel}"
						action="#{homeBean.doHistoricalCancel}" ajax="false" />
					<h:outputText
						value="#{pageText.page_home_link_historical_cancel_details}" />
					<p:commandButton value="#{pageText.page_home_link_logout}"
						action="historicalCancel" ajax="false" />
				</h:panelGrid>
			</h:form>

Code: Select all

public String doCustomerEntry() {
			
		return NAV_CUSTENTRY;
		
	}
Any help appreciated!
Using Primefaces-2.2SNAPSHOT on Glassfish 3.01

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

11 Feb 2011, 14:25

Hi,

is this a PrimeFaces of JSF question?

because

a) your navigation case may not be defined
b) your NAV_CUSTENTRY can be something that does not mean anything.
c) NAV_CUSTENTRY has incorrect definition.

does this work with h:commandButton?

Yigit

oidsman
Posts: 26
Joined: 07 Sep 2010, 21:26

11 Feb 2011, 15:36

I believe(?) that this is a primefaces question as the navigation does work with ajax="false" in the <p:commandButton> tag.

Having said that it could be my misunderstanding of the ajax methods and whether they can handle navigation rules??
Using Primefaces-2.2SNAPSHOT on Glassfish 3.01

oidsman
Posts: 26
Joined: 07 Sep 2010, 21:26

11 Feb 2011, 17:27

Ok - I have done some further reading and it looks like an ajax commandbuton won't do navigation (unless there is a re-direct in the backing bean action code). Leaving as ajax="false" is obviuolsy the best way (which kinda makes sense when you think about it!)
Using Primefaces-2.2SNAPSHOT on Glassfish 3.01

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

11 Feb 2011, 17:31


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 31 guests