1 Reply Latest reply on Jul 2, 2011 6:11 PM by Nick Belaevski

    Problem with modal dialog | Pls help

    Uwe Clement Newbie

      Hi there,

        

      i have the problem above, using a modal dialog in RichFaces.

        

      The Dialog is very simple:

       

      There is one TextArea, and one Button "Ok". The "OK"-Button should just be enabled when there is User Input in the TextArea.

        

      2 Problems:

       

      - The warnign above

      - And that the Dialog sometimes doesn't close after the user pressed the "OK"-Button.

       

       

      What we are doing wrong?

      Here is the code of the dialog:

       

       

       

      THANKS IN ADVANCE FOR YOUR SUPPORT!

       

       

       

      {code}

      <ui:composition 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:rich="http://richfaces.org/rich"

           xmlns:a4j="http://richfaces.org/a4j"

           xmlns:richx="http://richfaces.org/richx">

       

           <rich:modalPanel id="actionplanConfirmReopen" width="700" height="180"

                autosized="true">

                <f:facet name="header">#{msg.actionplanName} #{msg.reopenItem}</f:facet>

                <h:form>

       

                     <ui:decorate template="/layout/fields.xhtml">

                          <ui:decorate template="/layout/edit.xhtml">

                               <ui:define name="label">

                                    <h:outputLabel styleClass="Textarea"

                                         value="#{msg.reason}"></h:outputLabel>

                               </ui:define>

                               <ui:define name="input">

                                    <h:inputTextarea id="description22" styleClass="formElementText"

                                         rows="4" cols="35" style="width: 20em"

                                         value="#{actionplanEditController.comment}">

                                         <a4j:support ajaxSingle="true" reRender="btnTransitionReopen22"

                                              event="onkeyup"></a4j:support>

                                    </h:inputTextarea>

                               </ui:define>

                               <ui:define name="help">

                                    <!-- (ID 1/7) -->

                                    <a4j:outputPanel

                                         onclick="javascript:Richfaces.showModalPanel('ID_HELP_DIALOG_____help_detail_actionplan_confirmReopen_description')">

                                         <h:outputText value="?" styleClass="tooltip"></h:outputText>

                                         <!-- (ID 2/7) -->

                                         <rich:modalPanel

                                              id="ID_HELP_DIALOG_____help_detail_actionplan_confirmReopen_description"

                                              width="500" height="300">

                                              <f:facet name="header">

                                                   <h:panelGroup>

                                                        <h:outputText value="#{msg.help_window_title}"></h:outputText>

                                                   </h:panelGroup>

                                              </f:facet>

                                              <f:facet name="controls">

                                                   <h:panelGroup>

                                                        <!-- (ID 3/7) -->

                                                        <h:graphicImage value="/img/close.png" styleClass="hidelink"

                                                             id="ID_CLOSE_____help_detail_actionplan_confirmReopen_description"></h:graphicImage>

                                                        <!-- (ID 4/7) -->

                                                        <!-- (ID 5/7) -->

                                                        <rich:componentControl

                                                             for="ID_HELP_DIALOG_____help_detail_actionplan_confirmReopen_description"

                                                             attachTo="ID_CLOSE_____help_detail_actionplan_confirmReopen_description"

                                                             operation="hide" event="onclick"></rich:componentControl>

                                                   </h:panelGroup>

                                              </f:facet>

                                              <div id="helpPage">

                                              <div id="helpPageInner"><b>#{msg.reason}</b><br/>

                                              <br/>

                                              <!-- (ID 6/7) -->

                                              #{msg.help_detail_actionplan_confirmReopen_description}<br/>

                                              <br/>

                                              <br/>

                                              <!-- (ID 7/7) --> <a href=""

                                                   style="cursor: pointer; text-decoration: underline"

                                                   onclick="javascript:Richfaces.hideModalPanel('ID_HELP_DIALOG_____help_detail_actionplan_confirmReopen_description')"><strong>#{msg.close_window}</strong></a></div>

                                              </div>

                                         </rich:modalPanel>

                                    </a4j:outputPanel>

                               </ui:define>

                          </ui:decorate>

                     </ui:decorate>

       

                     <ui:decorate template="/layout/button.xhtml">

                          <ui:define name="button">

                               <a4j:commandButton id="btnTransitionReopen22"

                                    value="#{msg.Transition_Reopen}" title="#{msg.Transition_Reopen}"

                                    disabled="#{empty actionplanEditController.comment}"

                                    actionListener="#{actionplanEditController.performTransitionReopen}"

                                    onclick="Richfaces.hideModalPanel('actionplanConfirmReopen')"

                                     reRender="page"></a4j:commandButton>

                               <a4j:commandButton value="#{msg.cancel}" title="#{msg.cancel}"

                                    onclick="Richfaces.hideModalPanel('actionplanConfirmReopen')"></a4j:commandButton>

                          </ui:define>

                     </ui:decorate>

       

                </h:form>

           </rich:modalPanel>

      </ui:composition>

        {code}