简体   繁体   中英

a4j:commandbutton within f:ajax nested does not execute oncomplete

As you can see below, I have af:ajax nested in a a4j:commandLink, something similar to what I read here in order to solve a saving-on-db issue.

Now, when I click the commandLink, oncomplete is never call. That means, the modal does not close and the cursor keeps on "waiting" mode. If I remove the f:ajax, oncomplete is called but the saving-on-database comes back.

I have already tried several things but no one actually worked. Does anyway what might be the problem here?

Thanks in advance

<a4j:commandLink value="#{msg.label_accept}"
        onclick="this.disabled=true; document.body.style.cursor='wait';"
        action="#{backingBeanRef['select']}"
        oncomplete="this.disabled=false; document.body.style.cursor='auto';closeModal('modalDocumentationCenter');"
        styleClass="btn btn-default btn-einvoice"
        render="@this">
        <f:ajax execute="inputTitle inputDescription"/>
</a4j:commandLink>

a4j:commandLink has ajax already. So use execute from a4j:commandLink directly. Don't use another ajax tag. You can't (or, for sure, you shouldn't) use both.

Or I you really want to use f:ajax , then use h:commandLink instead of a4j:commandLink .

PS. You can try to use a4j:ajax , but I'm pretty sure the result will be the same as for f:ajax .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM