3 Replies Latest reply on Jan 30, 2011 6:13 PM by nbelaevski

    suggestionBox/Master + selectOneMenu/Detail

    edilmar

      Hi,

       

      I use JSF2/Richfaces3.3.3.

      I have a "suggestionBox for clients". When the user selects one client, I have to fill the "selectOne for client contacts".

      There are two database tables: Clients 1 - N ClientContacts.

       

      Then, I configured suggestionBox like this:

      <rich:suggestionbox id="client" ... OTHERCONFIGS ... process="client" reRender="clientContact"/>

       

      I thought that when the user selected a client, "process" tag would set my entity field "client", and automatically

      by "reRender" tag the method to fill "clientContact" would be called. But I put some System.out.println into method

      to fill "clientContact" and the "client" is always null.

       

      What's the problem with my logic for master/detail? Is there some other way to make this work?

        • 1. suggestionBox/Master + selectOneMenu/Detail
          liuliu

          your logic is good. I think you need post more your page code.

          • 2. suggestionBox/Master + selectOneMenu/Detail
            edilmar

            Hi,

             

            I solved using a4j:support into inputText:

            <h:inputText id="Pedido_cliente" value="#{pedido.entity.cliente}"

                         size="40"

                         required="true" requiredMessage="Campo Cliente obrigatóriona tabela ."

                         >

              <f:converter converterId="clienteConverter"/>

              <a4j:support ajaxSingle="true"process="Pedido_cliente" reRender="Pedido_clienteCont"event="onblur"/>

            </h:inputText>

            The only problem now is that when the user uses the mouse to select a client, the requiredMessaged is echoed. When using only keyboard, all works fine.

            • 3. suggestionBox/Master + selectOneMenu/Detail
              nbelaevski

              Hi Edilmar,

               

              Can you please post complete page code to show the relation between suggestionbox, 'client' component and 'Pedido_cliente'?