2 Replies Latest reply on Jul 31, 2007 10:55 AM by Syed H

    Problem When ajax outputPanel

    Thiagu Mariappan Novice

      i get the user name, password form modal panel, and also i validate it and displays the error message on the modal panel. if any error message on the modal panel i should not allowed to hide the modal panel. so i use ajax command button and ajax output panel on the modal panel.
      i have the problem of when a single field is invalidated all the invalidate message for other fields also displayed, i meant if any one of ajax call occurs i got all fields validation error message on my modal panel
      i give my sample code here

       <script type="text/javascript">
       function windowclose(){
       if ((document.getElementById('log:name1')==null)&&(document.getElementById('log:pass1')==null)){ Richfaces.hideModalPanel('login');
       };
       };
      
      </script>
      
      <rich:modalPanel id="login" height="650" width="600" zindex="2000">
       <a:form id="log">
       <s:decorate id="IdDe" template="edit.xhtml">
       <ui:define name="label">Username:</ui:define>
       <h:inputText id="username" value="#{user.siId}" required="true" immediate="true">
       <a:support event="onblur" reRender="IdDe"/>
       </h:inputText>
       </s:decorate>
       <a:outputPanel ajaxRendered="true">
       <h:message for="username" id="name1" style="color: red" />
       </a:outputPanel>
      
      <s:decorate id="passDec" template="edit.xhtml">
       <ui:define name="label">Password:</ui:define>
       <h:inputSecret id="password" value="#{user.password}" required="true" redisplay="true" immediate="true">
       <a:support event="onblur" reRender="passDec"/>
       </h:inputSecret>
       </s:decorate>
      <a:outputPanel ajaxRendered="true">
      <h:message for="password" id="pass1" style="color: red" />
      </a:outputPanel>
      <a:commandButton value="Login" type="submit" oncomplete="windowclose(); " action="#{identity.login}" />
      </a:form>
       </rich:modalPanel>
      

      and also i have one more problem is when the user loggod in i need to display the user name on my main page, but here the ajax call with refresh the page, i meant the page will not reloaded, so i can't display the user name on my main page. so how is it possible to reload my main page when the modal panel going to hide....
      please any one give me a right solution

        • 1. Problem with ajax outputPanel
          Thiagu Mariappan Novice

           

          "thiagu.m" wrote:
          i get the user name, password form modal panel, and also i validate it and displays the error message on the modal panel. if any error message on the modal panel i should not allowed to hide the modal panel. so i use ajax command button and ajax output panel on the modal panel.
          i have the problem of when a single field is invalidated all the invalidate message for other fields also displayed, i meant if any one of ajax call occurs i got all fields validation error message on my modal panel
          i give my sample code here
           <script type="text/javascript">
           function windowclose(){
           if ((document.getElementById('log:name1')==null)&&(document.getElementById('log:pass1')==null)){ Richfaces.hideModalPanel('login');
           };
           };
          
          </script>
          
          <rich:modalPanel id="login" height="650" width="600" zindex="2000">
           <a:form id="log">
           <s:decorate id="IdDe" template="edit.xhtml">
           <ui:define name="label">Username:</ui:define>
           <h:inputText id="username" value="#{user.siId}" required="true" immediate="true">
           <a:support event="onblur" reRender="IdDe"/>
           </h:inputText>
           </s:decorate>
           <a:outputPanel ajaxRendered="true">
           <h:message for="username" id="name1" style="color: red" />
           </a:outputPanel>
          
          <s:decorate id="passDec" template="edit.xhtml">
           <ui:define name="label">Password:</ui:define>
           <h:inputSecret id="password" value="#{user.password}" required="true" redisplay="true" immediate="true">
           <a:support event="onblur" reRender="passDec"/>
           </h:inputSecret>
           </s:decorate>
          <a:outputPanel ajaxRendered="true">
          <h:message for="password" id="pass1" style="color: red" />
          </a:outputPanel>
          <a:commandButton value="Login" type="submit" oncomplete="windowclose(); " action="#{identity.login}" />
          </a:form>
           </rich:modalPanel>
          

          and also i have one more problem is when the user loggod in i need to display the user name on my main page, but here the ajax call with refresh the page, i meant the page will not reloaded, so i can't display the user name on my main page. so how is it possible to reload my main page when the modal panel going to hide....
          please any one give me a right solution


          • 2. Re: Problem When ajax outputPanel
            Syed H Newbie

            Hi Thiagu,

            I am also having the same problem. Could you please let me know if you have resolved this issue?

            Thanks in advance..