7 Replies Latest reply on Jun 4, 2009 7:22 AM by nbelaevski

    Can not Validate

      Hi all.

      i have the index page look like as the following page:

      <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>JSP Page</title>
       </head>
       <body>
       <form
       <f:view>
      
       <h:form>
       <table border="0" cellpadding="0" cellspacing="0" style="left: 102px; width: 820px;
       position: absolute; top: 0px">
       <tr>
       <td colspan="3" style="width: 820px; height: 128px" valign="top">
       <jsp:include page="/pages/header.html" flush="true"/>
       </td>
       </tr>
       <tr>
       <td colspan="3" style="border-top: #ffffff 1px outset; width: 820px;background-color: #ffddcc;" valign="top">
       <jsp:include page="/pages/Menu.jsp" flush="true"/>
       </td>
       </tr>
       <tr>
       <td style="width: 180px; height: 19px ;background-color: #ffffcc;" align="center" valign="top">
      
       <jsp:include page="/pages/MenuLeft.jsp" flush="true"/>
       </td>
       <td colspan="2" style="width: 640px; height: 600px" valign="top">
       <a4j:outputPanel>
       <a4j:include viewId="/CreateAccount/wstep1.jsp"/>
       </a4j:outputPanel>
       </td>
       </tr>
       <tr>
       <td colspan="3" style="height: 25px" valign="top">
       <jsp:include page="/pages/footer.jsp" flush="true"/>
       </td>
       </tr>
       </table>
       </h:form>
       </f:view>
      
      
       </body>
      </html>


      i inserts into the index page view on the outputPanel in which the page is wstep1.jsp.

      In this case , i can not validate form of clicking on the next Button . to look like all action on this wstep1.jsp page is not available .

      if i run the wstep1.jsp is individual , i can validate the form when click on the next button.

      this is wstep1.jsp

      <
      html>
      
      <head>
       <link href="../css/style.css" rel="stylesheet" type="text/css"/>
      </head>
      <body>
      
      
      
       <h:panelGrid style="width:600px;" columns="2" border="0">
       <rich:panel header="Provide persional Information for Primary Account Holder:" style="background-color: #ebf3fd;">
       <h:form >
       <div style="position:relative;height:225px" align="center">
      
       <h:panelGrid rowClasses="s1row" width="550px" columns="4" >
       <h:outputText value="First Name:" />
       <h:inputText id="fn" value="#{Profile.firstName}" label="First Name" required="true" />
       <h:outputText value="Last Name:" />
       <h:inputText id="ln" value="#{Profile.lastName}" label="Last Name" required="true" />
       <h:outputText value=" "/>
       <rich:message for="fn" />
      
       <h:outputText value=" "/>
       <rich:message for="ln" />
      
       <h:outputText value="Email:" />
       <h:inputText id="email" value="#{Profile.email}" label="Email" required="true" />
       <h:outputText value="Verify Email:" styleClass="outputtext"/>
       <h:inputText id="verify" value="#{Profile.confirmEmail}" label="Verify Email" required="true"/>
       <h:outputText value=" "/>
       <rich:message for="email"/>
       <h:outputText value=" "/>
       <rich:message for="verify"/>
       <h:outputText value=" "/>
       <h:selectOneRadio value="#{Profile.typeaccount}" styleClass="outputtext">
       <f:selectItems value="#{Profile.typeAccountItems}"/>
       </h:selectOneRadio>
      
       </h:panelGrid>
      
       <a4j:commandButton style="float:right" action="next" value="next" styleClass="submitButton"/>
      
      
       </div>
      
       </h:form>
       </rich:panel>
       </h:panelGrid>
      
      
      
      
      </body>
      </html>


      please give me advice.

      thank regards
      skaka09

        • 1. Re: Can not Validate
          ilya_shaikovsky

          1) nested forms not allowed in JSF.

          2) using such include you got not only nested forms but html-head-body structures.. This also wrong.

          • 2. Re: Can not Validate

            Hi ilya_shaikovsky.

            if i separated the wstep1.jsp is individual with the index.jsp page , i can executed the next from in this situation (that is mean we did not put wstep1.jsp include into the index.jsp in which we run it individually) . we can Validation the form properly

            Why Is Validation wrong if we put wstep1 into index.jsp ?

            thank regards

            skaka09

            • 3. Re: Can not Validate
              nbelaevski

              JSF strictly prohibits nested forms.

              • 4. Re: Can not Validate

                How can you validate the form ?

                look such as : registration form on the index.jsp page contain the other pages.








                thank regards
                skaka09

                • 5. Re: Can not Validate
                  nbelaevski

                   

                  "skaka09" wrote:
                  How can you validate the form ?

                  Are you talking about s:validateAll?

                  • 6. Re: Can not Validate

                    In my opinion , when you import one pages into the other pages that the validation in form will be disable .

                    example like that:

                    i create two page : default.jsp page, and registration.jsp page.

                    in my registration.jsp page , the validation is effect on the form when user clicks on the register button.

                    But when i imports it into the default.jsp page in which registration.jsp page is not effect ,and not display something.

                    i don't know why ?

                    please help me?

                    • 7. Re: Can not Validate
                      nbelaevski

                       

                      "skaka09" wrote:
                      In my opinion , when you import one pages into the other pages that the validation in form will be disable .

                      That's not so.

                      Have you removed forms nesting? Post the code.