myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann...@reumann.net>
Subject understanding the impact of 'rendered'
Date Fri, 09 Sep 2005 18:58:14 GMT
I am trying to use the rendered attribute to decide whether to display 
an "insert" button or a "save" button (in reality they will end up both 
saying just save, but the action associated with them is different). 
Here is how I have the buttons set up:

<h:commandButton type="submit" id="insert" value="INSERT THIS EMPLOYEE" 
action="#{employeeAction.insertAction}" rendered="#{not 
employeeAction.editMode}"/>

<h:commandButton type="submit" id="update" value="#{msgs.save}" 
action="#{employeeAction.updateAction}" 
rendered="#{employeeAction.editMode}"/>

The buttons render exactly as expected - Insert button shows up when 
it's an insert being done, save being shown when it's an update. The 
poblem is I have no idea why the "insertAction" method is not firing 
when I use the rendered attribute! If I remove rendered so that I have...

<h:commandButton type="submit" id="insert" value="INSERT THIS EMPLOYEE" 
action="#{employeeAction.insertAction}" />

inertAction will fire just fine.

What has me more stumped is that the updateAction *does* work fine with 
the rendered attribute. What is causing the insertAction to be messed up 
when I use 'rendered' ?

-- 
Rick

Mime
View raw message