Is Any Way To Abort Ajaxbehaviorevent Listener Or Pass Additional Info To F:ajax Onevent?
I have created listener in my controller, something like that.. public class FooController { public void doSomething(AjaxBehaviorEvent evt) { closeDialogFlag = true;
Solution 1:
Here's a little trick for your specific problem:
- Create a
<h:inputHidden id="closeDialogFlag" value="#{fooController.closeDialogFlag}"/>
in the same<h:form>
as your<h:commandButton ... />
. Here, I suppose#{fooController.closeDialogFlag}
is of typeboolean
. - In your f:ajax:
- Render the component
closeDialogFlag
. - Change your condition in the onevent to:
function(data){ if(data.status === 'success' && $('input#closeDialogFlag').val() === 'true') { $('#migrationEditDialogModal').modal('hide'); } }
- Render the component
You will have to change $('input#closeDialogFlag')
to point to the correct ID (will depend on the parents' id).
This works because when data.status === 'success'
, the components are already rendered with their new values.
Post a Comment for "Is Any Way To Abort Ajaxbehaviorevent Listener Or Pass Additional Info To F:ajax Onevent?"