1

我有两组,inputText每组都有自己的commandbutton

如何自己验证commandbutton每个命令按钮不会影响另一个组

   <h:form xmlns:p="http://primefaces.org/ui"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:bizbiz="http://java.sun.com/jsf/composite/util">  

    <h:head>
        <title>#{msg.Maintitle}</title>
    </h:head>

    <h:body dir="#{msg.orientation}">
        <!--        <h:form>
                    <p:panelGrid columns="3">

                        <bizbiz:loginPage/>
                        <bizbiz:signUp/>
                        <bizbiz:languageBar/>           
                    </p:panelGrid>
                </h:form>-->
        <h:form>
            <p:panelGrid id="SignUpMainPanel">
                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.firstname}"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:inputText value="#{AccountInfo.firstName}"  required="true"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.lastname}" />
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:inputText value="#{AccountInfo.lastName}" required="true" />
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.companyname}"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:inputText value="#{AccountInfo.companyName}" required="true" />
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.position}"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:inputText value="#{AccountInfo.position}"  required="true"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.mobileemail}"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:inputText value="#{AccountInfo.bizBizNetId}" required="true"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.password}"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:password value="#{AccountInfo.password}" required="true"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.retype}"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:inputText required="true"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="#{signup_msg.termandcondition}"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <p:commandButton value="#{signup_msg.SignUp}" action="#{loginManagedBean.nextPage()}" ajax="false" process="@form" />
                    </p:column>
                </p:row>
            </p:panelGrid>
        </h:form>

        <h:form>
            <p:panelGrid id="mainContainer">  

                <p:row>
                    <p:column>
                        <h:outputLabel  value="#{login_msg.userName}: "  />  
                    </p:column>

                    <p:column>
                        <p:inputText  value="#{loginManagedBean.userName}"  id="username" label="username" required="true" />  
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel  value="#{login_msg.Password}: " />  
                    </p:column>

                    <p:column>
                        <p:password   value="#{loginManagedBean.password}" id="password" label="Surname" />  
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        #{login_msg.remmember}  <p:selectBooleanCheckbox id="rememberMe" value="#{loginManagedBean.remmember}" /> 
                    </p:column>
                    <p:column>
                        <!--                        <p:message/> -->
                    </p:column>

                </p:row>


                <p:row>
                    <p:column>
                    </p:column>

                    <p:column>
                        <p:commandButton  value="#{login_msg.Login}" action="#{loginManagedBean.nextPage()}" ajax="false" process="@form" id="persianButtom"  icon="ui-icon-check" style="margin:0"/>  
                    </p:column>

                </p:row>

            </p:panelGrid>  
        </h:form>
    </h:body>

</h:form>  
4

1 回答 1

0

p:panelGrid以不同的形式包括每一个怎么样。像这样的东西:

<h:form>
  <p:panelGrid id="panel1" columns="1">
    <p:inputText value="#{AccountInfo.firstName}"  required="true"/>
    <p:inputText value="#{AccountInfo.lastName}"  required="true"/> 
    <p:commandButton value="Sign Up" action="#{signUpManagedBean.signUp()}" ajax="false" />
  </p:panelGrid>
</h:form>

<h:form>
  <p:panelGrid id="panel2" columns="1">
    <p:inputText value="#{UserInfo.userName}"  required="true"/>
    <p:inputText value="#{UserInfo.password}"  required="true"/> 
    <p:commandButton value="Login" action="#{signUpManagedBean.login()}" ajax="false" />
  </p:panelGrid>
</h:form>
于 2013-03-03T13:23:44.053 回答