7 Replies Latest reply on May 7, 2009 10:09 AM by romyo0o

    Modal Panel problem

    romyo0o

      i'm Using Modal Panel and it contain <h:selectOneradio
      while i load it for the first time like this :
      [img]http://www.freewebtown.com/romyo0o/1jspx.jpg[/img]
      every thing is OK

      then i selcet one option and type any thing and press ok to hide the ModalPanel like this :
      [img]http://www.freewebtown.com/romyo0o/2jspx.jpg [/img]

      then when i load the modal panel again i found that the option i was select is still selected like this :
      [img]http://www.freewebtown.com/romyo0o/3jspx.jpg[/img]

      in fact it's not selected actually just rendered selected and i must select it again to listen that the component selected

      so what shall I do ?

      thanks :)[/url]

        • 1. Re: Modal Panel problem
          romyo0o

          i don't know why images is disappear but u can got o the link and see it :)

          • 2. Re: Modal Panel problem
            ilya_shaikovsky

            please show the code also.

            • 3. Re: Modal Panel problem
              romyo0o

               

               <rich:modalPanel id="mp" minHeight="200" minWidth="450"
               height="200" width="500">
               <f:facet name="header">
               <h:outputText value="Modal Panel Title" />
               </f:facet>
               <f:facet name="controls">
               </f:facet>
               <p>Any JSF content might be inside the panel. In case of using
               Facelets or JSF 1.2, it might be any mixed content.</p>
              
               <p>The RichFaces modal panel is good with &lt;a4j:include&gt; to create
               a wizard like behavior.</p>
               <p>The model panel is open and closed from the javascript function
               on <i>Richfaces</i> object. The following code
               <h:selectOneRadio id="changeAmountAccountAdminRadioBtns" >
               <f:selectItem id="addAmountAccountAdmin" itemLabel="Add Amount" itemValue="add" />
               <f:selectItem id="subtractAmountAccountAdmin" itemLabel="Subtract Amount" itemValue="subtract" />
               </h:selectOneRadio>
              
               <a href="#" onclick="#{rich:component('mp')}.hide()">hide this panel</a>:
               <f:verbatim>&#35;</f:verbatim>{rich:component('mp')}.hide()</p>
              
              
               </rich:modalPanel>


              • 4. Re: Modal Panel problem
                ilya_shaikovsky

                seems you posted too simplified code. Actually with this code snippet - such result will be fine. You show the modal with client side function then select the option and close also just using client side api. So the panel just changed its visibility. But you perform nothing to clear the select value.

                • 5. Re: Modal Panel problem
                  romyo0o

                  so what shall i do to clear the value ???

                  • 6. Re: Modal Panel problem
                    ilya_shaikovsky

                    you could use js.. or if you opening with ajax request - clear the components values..

                    • 7. Re: Modal Panel problem
                      romyo0o

                      Thanks,

                      i've Solved the problem using this code of Java Script

                      function unset(radioComponent) {
                       var num = 4;
                       for (var i=0;i<num;i++) {
                       var object = eval(document.getElementById(radioComponent+":"+i));
                       object.checked = false;
                       }
                       }