preload
Apr 24

I added a render attribute on one of my commit buttons in order to hide the button based on some business logic. I quickly found out that this will kill the ability for your form to commit. The fix is to move the render logic out to a enclosing af:panelGroup. Here is the change:

Before:
<af:commandButton actionListener=”#{bindings.Commit.execute}”
action=”#{backing_TerminalEditMode.flipToViewMode}”
rendered=”#{backing_TerminalEditMode.editMode == \’edit\’
text=”Commit”/>

After:
<af:panelGroup rendered=”#{backing_TerminalEditMode.editMode == \’edit\’}”>
<af:commandButton actionListener=”#{bindings.Commit.execute}”
action=”#{backing_TerminalEditMode.flipToViewMode}”
text=”Commit”/>
<af:commandButton actionListener=”#{bindings.Rollback.execute}”
text=”Rollback” immediate=”true”>
<af:resetActionListener/>
</af:commandButton>
</af:panelGroup>

Tagged with: