0 Replies Latest reply on Feb 6, 2009 1:03 AM by valatharv

    Strange behaviour for xhtml when using modal

    valatharv
      Strange behaviour....

      Please help, it is very important....

      I am trying to open modal panel, it works fine when there is NO validation error.

      Scenario:
      For example if there are duplicate number in text field, I am validating and render the form.

      a) At this point, when I click "Update" button, modal pops-up for a second, and error message is displayed on the parent screen.

      b) When I click again keeping duplicate number,  MODAL does not work and COMPLETE XHTML SCREEN is DISPLAYED TWICE.. :(

      c) If I click again after changing to unique number in text fields, MODAL does not pops-up but message is displayed "Your request is in progress, please wait..." on the top-left corner of the browser....

      Please suggest what I am doing wrong...

      XHTML code:
      ----------
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                      xmlns:s="http://jboss.com/products/seam/taglib"
                      xmlns:ui="http://java.sun.com/jsf/facelets"
                      xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:h="http://java.sun.com/jsf/html"
                      xmlns:a="http://richfaces.org/a4j"
                      xmlns:rich="http://richfaces.org/rich"
                      template="layout/template.xhtml">
                            
      <ui:define name="body">
         
          <h:messages globalOnly="true" styleClass="message" errorClass="errors" infoClass="info" id="globalMessages"/>

      <div align="center">
           <a:status id="commonstatus"  startText="Request In progress... Please wait..." stopText="" startStyleClass="ajaxmessage"/>
          </div>
          <br/>
         
          <h:form id="quantExperiment" styleClass="edit">
      <ui:repeat value="#{quantExperimentHome.reagentForExp}" var="info" >       
        <h:inputText required="true" value="#{info.number}"/>
        ...
      </ui:repeat>
        ...
      <f:subview xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:a4j="http://richfaces.org/a4j"
         xmlns:rich="http://richfaces.org/rich">
          <rich:modalPanel id="panel" width="400" height="120">
           <f:facet name="header">
            <h:panelGroup>
             <h:outputText value="In progress..."></h:outputText>
            </h:panelGroup>
           </f:facet>
           <f:facet name="controls">
            <h:panelGroup>
             <!--<h:graphicImage value="/images/modal/close.png" styleClass="hidelink" id="hidelink"/>-->
             <!--<rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>-->
            </h:panelGroup>
           </f:facet>
           <h:outputText styleClass="info" value="Your request is in progress, please wait..."></h:outputText>
          </rich:modalPanel>
         
          <a4j:commandButton value="Update Experiment" id="update"
         title="Updates the current experiment"
           action="#{quantExperimentHome.update}"
            rendered="#{quantExperimentHome.managed}"
            onclick="this.disabled=true">
           <rich:componentControl for="panel" attachTo="update" operation="show" event="onclick"/>
          </a4j:commandButton>
         
          <a4j:commandButton id="save" title="Creates new experiment for the existing project"
            value="Save Experiment"
           action="#{quantExperimentHome.persist}"
            disabled="#{!quantExperimentHome.wired}"
            rendered="#{!quantExperimentHome.managed}"
            onclick="this.disabled=true">
           <rich:componentControl for="panel" attachTo="save" operation="show" event="onclick"/>
          </a4j:commandButton>
           
      </f:subview>
      </h:form>