次のコードは、フォームを再レンダリングしません。
xhtml:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="/WEB-INF/templates/default.xhtml">
<ui:define name="content">
<h:form id="form">
<rich:panel header="My Header">
<h2>
<h:outputLabel value="#{tournamentBean.mode}" />
</h2>
<a4j:commandButton value="Toggle"
action="#{tournamentBean.toggleMode()}" render="form" />
</rich:panel>
</h:form>
</ui:define>
</ui:composition>
豆:
import java.io.Serializable;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
@SuppressWarnings("serial")
@Named("tournamentBean")
@ViewScoped
public class TournamentBean implements Serializable {
private String mode = "A";
public String getMode() {
return mode;
}
public void toggleMode() {
if (this.mode.equals("A"))
this.mode = "B";
else
this.mode = "A";
}
}
私は Wildfly 8.0 を使用しているため、JSF 2.2 を使用しています。ボタンがクリックされるたびに、メソッド toggleMode が呼び出されます。IE 11 では、フォームを再レンダリングしません。Chrome では 2 回機能しますが、それ以上は機能しません。
私は何が欠けていますか?