1 Reply Latest reply on May 19, 2010 2:46 PM by Walter Hernandez

    how can i binding a property from modalpanel?

    Walter Hernandez Newbie

      Hi, i'm doing a searcher customer on a modal panel...

      I'm trying to binding a property from modal panel, but doesn't work:

       

      Here is my source:

       

      <rich:modalPanel id="idPanelBuscadorCliente" width="251" height="225"
                      shadowDepth="10" resizeable="false" left="394" top="170" moveable="false">
                      <f:facet name="header">
                          <h:panelGroup>
                              <h:outputText value="Buscador cliente"></h:outputText>
                          </h:panelGroup>
                      </f:facet>
                      <f:facet name="controls">
                          <h:panelGroup>
                              <h:graphicImage value="/recursos/botones/CerrarModalPanel.png"
                                  styleClass="hidelink" id="hidelink"
                                  onmouseover="this.style.cursor='hand'" />
                              <rich:componentControl for="idPanelBuscadorCliente"
                                  attachTo="hidelink" operation="hide" event="onclick" />
                          </h:panelGroup>
                      </f:facet>
         
                      <h:panelGroup>
                          <h:outputLabel value="#{res['cliente.razonsocial']}"
                              for="idFiltroClienteBuscador" />
                      <rich:spacer width="10" />
                          <h:inputText id="idFiltroClienteBuscador" value="#{stockAction.filtroClienteProveedor.razonSocial}" />
                          <a4j:commandButton
                              onmouseover="this.style.cursor='hand'"
                              actionListener="#{stockAction.filtrarClienteProveedor}"
                              reRender="idExtendedDataTableClientesProveedores"
                              style="background-image: url(./recursos/botones/Buscar.png);" />
                      </h:panelGroup>
                      <rich:extendedDataTable id="idExtendedDataTableClientesProveedores" value="#{stockAction.listaClientesProveedoresTabla}"
                          var="clienteProveedorActual" rows="5" style="position: relative; top: 10px;"
                          height="159px"
                          enableContextMenu="false">
                          <rich:column sortBy="#{clienteProveedorActual.razonSocial}" width="109%">
                              <f:facet name="header">
                                  <h:outputText value="#{res['cliente.razonsocial']}" />
                              </f:facet>
                              <h:outputText
                                  value="#{stockSimpleActual.clienteProveedor.razonSocial}" />
                              <h:outputText value="#{clienteProveedorActual.razonSocial}" />
                          </rich:column>
                          <a4j:support event="onRowDblClick" action="#{stockAction.seleccionarClienteProveedorFiltro}" reRender="idListarStockRichPanel" onbeforedomupdate="Richfaces.hideModalPanel('idPanelBuscadorCliente');" focus="idFiltroCliente"/>
                         
                      </rich:extendedDataTable>
         
                  </rich:modalPanel>

       

      The problem is in  <h:inputText id="idFiltroClienteBuscador"  value="#{stockAction.filtroClienteProveedor.razonSocial}" />

      My commandButton call filtrarClienteProveedor in the backing bean.

       

      public void filtrarClienteProveedor(ActionEvent event) {
                  this.setListaClientesProveedoresTabla(new ListDataModel<ClienteProveedor>(servicioClienteProveedor.getLista(this.getFiltroClienteProveedor())));
            }


      the property "razonSocial" in FiltroClienteProveedor instance always is empty,

      if i render my inputText outside modalPanel, this property work fine.

       

      any idea?

        • 1. Re: how can i binding a property from modalpanel?
          Walter Hernandez Newbie

          Solved!

           

          The correct structure is this:

           

          Parent page

          ...

          <a4j:form>

          ...

          </a4j:form>
          <a4j:include viewId="/paginas/maestro/stock/BuscarClienteProveedorModalPanel.xhtml" />

           

          note that the "BuscarClienteProveedorModalPanel.xhtml" is included outside form.

           

          ModalPanel page (BuscarClienteProveedorModalPanel.xhtml)

           

          <rich:modalPanel>
                      <f:facet name="header">

                         ...
                      </f:facet>
                      <f:facet name="controls">

                         ...

                      </f:facet>
                      <a4j:form>

                         ...

                      </a4j:form>

          </rich:modalPanel>

           

          note that the fom is inside modalpanel.

           

          Now, the properties are binding correctly inside modalpanel...