Meaningless Drivel is fun!*
The moose likes JSF and the fly likes question on a4j:commandButton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "question on a4j:commandButton " Watch "question on a4j:commandButton " New topic
Author

question on a4j:commandButton

evelyn ong
Greenhorn

Joined: Aug 03, 2010
Posts: 13
does <a4j:commandButton> navigate to the next view after form submit? i have a form using <a4j:commandButton> as my submit button, but however, when i submit the form, the next view does not change, the action method have been called.
Frederic Filiatrault
Ranch Hand

Joined: Jul 12, 2004
Posts: 69
Stupid question but would you append to have any javascript on the way blocking the form submission?

Try a sniffer to see if any ajax calls are sent. You would be 100% sure in this case.


F.<br />SCJP, SCJD, SCWCD, SCBCD<br /> <br />Failure is not an option... It comes with the software bundle.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

If the action method does not return a valid navigation token, the current page is redisplayed. Same as for a normal commandButton.


Customer surveys are for companies who didn't pay proper attention to begin with.
Max Katz
Ranch Hand

Joined: Aug 03, 2009
Posts: 72
a4j:commandButton shouldn't really be used for navigating, it's used to update the same page. If you really need to navigate, then you need to use <redirect/> with your navigation rule.


Blog: http://mkblog.exadel.com
HTML Prototypes: http://gotiggr.com
evelyn ong
Greenhorn

Joined: Aug 03, 2010
Posts: 13
Max Katz wrote:a4j:commandButton shouldn't really be used for navigating, it's mean to update the same page. If you really need to navigate, then you need to use <redirect/> with your navigation rule.


I have use <redirect/> on my naviagation rule. when i click on the button, the page is refresh, but view is not change.
Max Katz
Ranch Hand

Joined: Aug 03, 2009
Posts: 72
Make sure the navigation rules is correct and the outcome you use. Also, try using a standard button (h:commandButton) to see if it navigates.
evelyn ong
Greenhorn

Joined: Aug 03, 2010
Posts: 13
it navigates when i using <h:commandbutton>.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

You probably should post an example. Some of the JavaScript attributes have an inherent boolean functionality that will cause the submit to be suppressed unless you explicitly return true or false from them as required.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question on a4j:commandButton
 
Similar Threads
a4j:commandButton not working after using rich:suggestionBox and a4j:support
simple jsf form
jsf and javascript
a4j command button not functioning
javax.el.PropertyNotFoundException: Property 'logoutUser' not found on type org.ssc.webapp.UserLogin