开发者

a4j:commandButton oncomplete javascript ignored

I have this snippet:

  <h:form>
        <h:panelGrid columns="2" styleClass="modalYesNo">开发者_运维问答;
            <a4j:region id="confirmActionReloadYes">
                <a4j:commandButton value="Yes" ajaxSingle="true"
                    action="#{MyBacking.reloadConfig}"
                    oncomplete="window.location.reload()"
                    reRender="blah" />
            </a4j:region>
            <a4j:commandButton value="No"
                onclick="#{rich:component('confirmActionReload')}.hide();return false;" />
        </h:panelGrid>
    </h:form>

and I notice that when the yes button in the a4j:region above is selected, once the backing bean method reloadCongi() is complete, the javascript window.location.reload() is not run. Why is this? I also notice that elements in the reRender attribute are also not reRendered. Why is this?

EDIT The method from the first comment to this question is:

public void reloadConfig() {
    logger.info("Reloading config.");
    pct = pctBackup;
    feeds = pct.getFeed();
    setSysMsg("Reloaded config OK.", "ok");
}

I'm thinking maybe I need to set the return type to true or false based on the above and see if that works.


Some addons may compromise the firing of the 'oncomplete' event. If you are out of options, start disabling some addons to see if it works. Specifically I had the same problem with Firefox 14.0.1 and Firebug 1.7.3. Once I disabled Firebug, the 'oncomplete' worked again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜