我试过保持eah fieldset的不同形式,并通过保持不同的面板和删除fieldset尝试它,但我不能让按钮工作。而且如果我在下面发布的代码中删除第三个字段集,则另外两个字段集正在运行。
<h:form styleClass="pageContainer" xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core" id="form22">
<p:toolbar styleClass="toolBar">
<p:toolbarGroup align="right">
</p:toolbarGroup>
</p:toolbar>
<h:form prependId="false">
<p:fieldset legend="Change Name">
<h:panelGrid styleClass="registration_form">
<h:panelGrid columns="3" id="name_form1" >
<h:outputText value="Name"/>
<p:inputText value="#{userMB.user.name}" id="name"
style="width:250px; margin-left:58px;" required="true" label="Job Title">
<f:validateLength minimum="5" maximum="50"></f:validateLength>
</p:inputText>
<p:commandButton id="reportButton1" styleClass="update" value="Update" action="#{adminMB.updateUserName}" update=":form22" />
</h:panelGrid>
</h:panelGrid>
</p:fieldset>
<p:fieldset legend="Change Password">
<h:panelGrid styleClass="registration_form">
<h:panelGrid columns="2" >
<h:outputLabel for="oldPassword" value="Old Password:" />
<p:password value="#{adminMB.password}" id="oldPassword" style="width:250px" label="Old Password"/>
<h:outputLabel for="NewPassword" value="New Password:" />
<p:password id="NewPassword" value="#{adminMB.newpassword}" match="ConfirmPassword" label="NewPassword" style="width:250px"/>
<h:outputLabel for="ConfirmPassword" value="Confirm Password:" />
<p:password id="ConfirmPassword" value="#{adminMB.newpassword}" label="ConfirmPassword" style="width:250px"/>
<p:commandButton id="reportButton2" styleClass="update" value="Update" action="#{adminMB.updateUser()}" update=":form22" />
</h:panelGrid>
</h:panelGrid>
</p:fieldset>
<p:fieldset legend="Signature">
<h:panelGrid styleClass="registration_form">
<h:panelGrid columns="3" >
<h:outputText value="Enter Signature" />
<p:editor id="Question" width="500" height="100" style="border:1px solid silver"
controls="bold italic underline font color highlight bullets numbering outdent indent rule pastetext"
value="#{adminMB.signaturemsg}"
label="Question" required="true" > </p:editor>
<p:commandButton id="reportButton3" styleClass="update" value="Update" action="#{adminMB.updateUserName()}"/>
</h:panelGrid>
</h:panelGrid>
</p:fieldset>
<p:growl id="message" />
</h:form>
</h:form>