• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on a4j:commandButton

 
evelyn ong
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18154
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the action method does not return a valid navigation token, the current page is redisplayed. Same as for a normal commandButton.
 
Max Katz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
evelyn ong
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it navigates when i using <h:commandbutton>.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18154
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic