Action method never called

Hello,

I have identified a problem with my app which really puzzles me:

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

<h:commandButton action="#{ContractManagedBean.updateContractAction}" image="images/update.png" rendered="#{ContractManagedBean.contractForUpdate}"/>

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

<h:commandButton action="#{ContractManagedBean.updateContractAction}" image="images/update.png" rendered="true"/>

What I am missing?

Thanks in advance,

Julien.

pS. I have no error messages displayed by the h:messages and when I click the button the whole of the lifecycle run through all phases without problems.

[1061 byte] By [balteoa] at [2007-11-27 7:09:09]
# 1

Likely the contractManagedBean is in request scope and the booleanvalue is reinitialized when JSF enters the invoke application phase. Put the contractManagedBean in session scope. If it works, and you want to keep it in request scope, then you may need to review your design. Pass the booleanvalue to the next request using h:inputHidden or requestMap.

BalusCa at 2007-7-12 19:00:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hello BalusC,

Thanks for your reply!!

On a different note, I would greatly appreciate your advice on a different topic but was not able to find you email address nor was I able to register on your forum as I don't speak Dutch so I take the liberty to post my question here:

Which ajax framework would you advice to go with jsf?

Thanks in advance,

Julien.

balteoa at 2007-7-12 19:00:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...