0

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.

a4j:commandButton

rich:componentControl

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.

4

1 回答 1

3

您是否尝试过良好的语法:

oncomplete="#{rich:component('firstPopup')}.hide();#{rich:component('confirmPopup')}.hide();"
于 2013-06-04T11:57:11.027 回答