Tag: 条件性渲染

在有条件渲染的组件中提交表单不会被处理

我有一个自定义标记文件的forms: <h:form> <h:commandButton value="click"> <f:ajax event="click" listener="#{bean[method]}" /> </h:commandButton> </h:form> 我有条件地通过ajax如下所示: <h:panelGroup id="test"> <h:form> <h:commandButton value="click"> <f:ajax event="click" listener="#{backingTest.updateFlag}" render=":test"/> </h:commandButton> </h:form> <h:panelGroup rendered="#{backingTest.flag}"> <my:customtag bean="#{backingTest}" method="printMessage"/> </h:panelGroup> </h:panelGroup> 这是关联的支持bean: import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class BackingTest { private boolean flag = false; public void printMessage() { System.out.println("hello"); } public void updateFlag() { […]