File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Action method never gets called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Action method never gets called" Watch "Action method never gets called" New topic
Author

Action method never gets called

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,
I have identified a problem with my app which really puzzles me:

When I specify programmatically whether a command button should be rendered, the action method never gets called whereas the button does get rendered. See below:



When I specify declaratively whether the button should be rendered, the action method does get called. See below:



What I am missing?

Thanks in advance,

Julien.
Gabriel Claramunt
Ranch Hand

Joined: May 26, 2007
Posts: 375
Weird, almost look like a bug.
Can you post the line as rendered in HTML in the page?
It would be interesting to see what is submitted in each button...


Gabriel
Software Surgeon
Tak Ng
Greenhorn

Joined: Jun 05, 2007
Posts: 19
Do you have any validation on the fields of your form? If a validation fails, your action method will not get called.

Anyway, you nice to post the HTML code and the java class linked to it in order for anyone to help you.
Gabriel Claramunt
Ranch Hand

Joined: May 26, 2007
Posts: 375
Originally posted by Tak Ng:
Do you have any validation on the fields of your form? If a validation fails, your action method will not get called.

Anyway, you nice to post the HTML code and the java class linked to it in order for anyone to help you.

You're right, maybe is a validation problem... maybe ContractManagedBean.contractForUpdate doesn't evaluate to boolean?? (just a wild guess)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Action method never gets called