first of, an explanation of what I'm trying to achieve:
I'm opening up a popup panel from a form. This popup has the ability to open a second popup (confirmation) which then calls an action from the server and also closes both popups when the action is complete.
How can I close both popups after completion of the action (ActionListener)?
Here are my two examples:
<!-- language: lang-html -->
<a4j:commandButton value="execute"
action="#{navigationController.navigateSomewhere}"
actionListener="#{beanController.doSomething}"
render="datatable,navigationDiv">
<rich:componentControl event="click" target="firstPopup, confirmPopup"
operation="hide" />
</a4j:commandButton>
The componentControl seems to disable XHR calls, is that intended or not?
<!-- language: lang-html -->
<a4j:commandButton value="execute"
action="#{navigationController.navigateSomewhere}"
actionListener="#{beanController.doSomething}"
render="datatable,navigationDiv"
oncomplete="#{rich:component('firstPopup')}.hide()
#{rich:component('confirmPopup')}.hide()">
</a4j:commandButton>
It's clear that the second suggestion will not work, also by adding "AND" neither. By the way I'm using Richfaces 4.3.1 and JSF 2.0. After removing componentControl, the XHR call goes through successfully, but both popups will still remain on the display. Here additionally both links to the VDL documentation of the components.
According to the description of componentControl, my application shouldn't behave this way:
The behavior allows JavaScript API functions to be called on target components. The functions are called after defined events are triggered on the component to with the behavior is attached. Initialization variants and activation events can be customized, and parameters can be passed to the target component.