Announcement Announcement Module
Collapse
No announcement yet.
CommandButton performing 2 actions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CommandButton performing 2 actions

    Hi all,

    I'm trying to make a command button that will appear in a modal window. When the user clicks the button it must perform a method on a backing bean and then close the modal window.

    Currently I am using the action on the button to go to a transition and evaluate and expression in between. I then have my onComplete set up to close the window. My problem is that with using a transition to evaluate the expression, my onComplete never registers, so the method is run, but the window stays open. Attached is relevant code, let me know if there's anything else I can provide. Any and all help is appreciated, thanks.

    Code:
    <a4j:commandButton value="Close"
    	action="close"
    	oncomplete="javascript:Richfaces.hideModalPanel('modalPanel');"
    	rerender="myModalDiv">					</a4j:commandButton>
    Code:
    <view-state id="display_page">
    	<transition on="search" to="search_page">	</transition>
    	<transition on="logout" to="logout_page">	</transition>
    	<transition on="close"  to="display_page">
    		<evaluate expression="queryCancelBean.cancelQuery()"/>
    	</transition>
    </view-state>
Working...
X