私はこのスニペットを持っています:
<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>
上記の a4j:region で [はい] ボタンを選択すると、バッキング Bean メソッドreloadCongi()
が完了すると、JavaScriptwindow.location.reload()
が実行されないことに気付きました。どうしてこれなの?また、reRender 属性の要素も reRender されていないことに気付きました。どうしてこれなの?
編集 最初のコメントからこの質問への方法は次のとおりです。
public void reloadConfig() {
logger.info("Reloading config.");
pct = pctBackup;
feeds = pct.getFeed();
setSysMsg("Reloaded config OK.", "ok");
}
上記に基づいて戻り値の型を true または false に設定し、それが機能するかどうかを確認する必要があるのではないかと考えています。