5 Replies Latest reply on Sep 26, 2007 11:17 AM by Mike Slyter

    Problem Getting Data into a ModalPanel

    Mike Slyter Newbie

      I am just starting with richfaces and have the following problem:

      Here is the control in my page:

      <t:inputText id="setpressure" readonly="false" styleClass="permitdata" value="#{boilerPermitMB.safetyValveSetPressure}" onblur="javascript:validateSetPressure()" />


      Here is the javascript that is called in the onblur method:
      function validateCapacities()
      {
      var capacity = parseInt($('form1:boilercapacity').value);
      var valvecapacity = parseInt($('form1:valvecapacity').value);
      if(capacity != null && valvecapacity != null)
      {
      if(valvecapacity > capacity){
      $('form1:message').value = "The valve capacity is larger than the capacity of the item! If this is correct please make a special note in the comment section.";
      showPanel();
      }
      }
      }
      
      function showPanel(){
      Richfaces.showModalPanel('mp',{width:450, top:200});
      }
      


      Here is code for the richfaces modal panel:
      <rich:modalPanel id="mp" minHeight="200" minWidth="450"
       height="200" width="500" zindex="2000">
       <a4j:support event="onshow" reRender="mp">
       </a4j:support>
       <f:facet name="header">
       <h:outputText id="messageText" value="Alert Message" />
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/images/modal/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
       </f:facet>
       <t:outputText forceId="true" id="messageDisplay">
       <f:verbatim><script>document.write($('form1:message').value)</script></f:verbatim>
       </t:outputText>
      
      </rich:modalPanel>
      


      I cannot get the data that was set in the function to display in the page. I look at the page with a dom inspector and the value is set I just cant get the panel to rerender.

      Any help or Ideas would be appreciated. Does anyone have a complete example of passing variables in the show method? I tried the one in the docs and it said that the item was not defined?