aspose file tools
The moose likes JSF and the fly likes Command Button Action not fired---Strange Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Command Button Action not fired---Strange Issue" Watch "Command Button Action not fired---Strange Issue" New topic
Author

Command Button Action not fired---Strange Issue

Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

This is my code
<t:commandButton value="View Previous Year's History" rendered = "#{ myBean.paymentYear == 'C' }" action="#{myBean.doAction}"/>

The action is not fired in this case. But in all the following cases action is fired

1. If i give <t:commandButton value="View Previous Year's History" rendered = "true" action="#{myBean.doAction}"/>
2. Or if i put the scope of my backing bean as session, action is fired
3. Or if i give
<t:saveState id="test" value="#{myBean.paymentYear }"/> also the action is fired..
I have no clue. Can anybody help?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You need to make sure that the rendered attribtue evaluates true when the action method is to be determined (during apply request values phase of the subsequent request). So if #{myBean.paymentYear} should be retained in the next request, you need to wrap it in a h:inputHidden or, as you already found out, the t:saveState.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Command Button Action not fired---Strange Issue
 
Similar Threads
Problem using rendered attribute in Command Button
IExplorer and general troubles... like loss of sanity.
Validation error / unknown cause
strachable columns in jsf
Command Button Action not fired..Please help