0 Replies Latest reply on Dec 27, 2010 4:35 PM by Anna Ayscha

    Modal panel and inplaceSelector problem

    Anna Ayscha Newbie

      Hello,

       

      I have some troubles with my web-app with modalPanel, i think it works incorrect.

      So, I have modalPanel where there are one inplaceSelector field and save button. By selecting line from Selector and puching button the Value of choosed item should be stored on controller.

      But the returned value found to be null. --- NullPointerException.

       

      The interesting is that on the another page I have the same way of data choosing but not in the modalPanel but on new page. Everything works perfectly.

       

      Maybe there are some problems in working Modal panels together with inplaceSelector??

       

      Here is my modalPanel code:

       

      <rich:modalPanel id="addPanel" autosized="true" width="200">
             <f:facet name="header">
                 <h:outputText value="Choose route item to add."
                     style="padding-right:15px;" />
             </f:facet>
             <f:facet name="controls">
                 <h:panelGroup>
                     <h:graphicImage value="/images/icons/close.png"
                         styleClass="hidelink" id="hide_add_link" />
                     <rich:componentControl for="addPanel" attachTo="hide_add_link"
                         operation="hide" event="onclick" />
                 </h:panelGroup>
             </f:facet>
           
             <h:form>
                     <h:panelGrid style="width:200px;" layout="block">
      <rich:inplaceSelect value="#{tourController.selectedRouteId}"
      defaultLabel="Choose town..">
      <f:selectItems value="#{tourController.townsList}" />
      </rich:inplaceSelect>
      </h:panelGrid>
           
                 <table width="100%">
                     <tbody>
                         <tr>
                             <td align="center" width="50%">
                                  <a4j:commandButton value="Add"
                                 ajaxSingle="true" action="#{tourController.addRouteItem}"
                                 oncomplete="#{rich:component('addPanel')}.hide();"
                                 reRender="routesTable"/>
                         </td>
                             <td align="center" width="50%">
                                  <a4j:commandButton
                                      value="Cancel"
                                           onclick="#{rich:component('addPanel')}.hide();return false;" />
                             </td>
                         </tr>
                     </tbody>
                 </table>
             </h:form>
         </rich:modalPanel>  

      <rich:modalPanel id="addPanel" autosized="true" width="200">

              <f:facet name="header">

                  <h:outputText value="Choose route item to add."

                      style="padding-right:15px;" />

              </f:facet>

              <f:facet name="controls">

                  .................

                     </f:facet>

                  

              <h:form>

            <h:panelGrid style="width:200px;" layout="block">

      <rich:inplaceSelect value="#{tourController.selectedRouteId}"

      defaultLabel="Choose town..">

      <f:selectItems value="#{tourController.townsList}" />

      </rich:inplaceSelect>

      </h:panelGrid>

            

                  <table width="100%">

                      <tbody>

                          <tr>

                              <td align="center" width="50%">

                              <a4j:commandButton value="Add"

                                  ajaxSingle="true" action="#{tourController.addRouteItem}"

                                  oncomplete="#{rich:component('addPanel')}.hide();"

                                  reRender="routesTable"/>

                          </td>

                              <td align="center" width="50%">

                              <a4j:commandButton

                                  value="Cancel"

                                 onclick="#{rich:component('addPanel')}.hide();return false;" />

                              </td>

                          </tr>

                      </tbody>

                  </table>

              </h:form>

          </rich:modalPanel>  

       

      Very need your thoughts. Thank's a lot in advance!!