4 Replies Latest reply on Nov 19, 2009 7:25 AM by pappy

    listShuttle and ajaxSingle problem

    pappy

      Hello

      I have the following listShuttle in a form

      <rich:listShuttle var="v" converter="..." ....>
       <rich:column>
       <h:selectOneMenu id="select" value="#{v.value}">
       <f:selectItems .... />
      
       <a4j:support event="onchange" ajaxSingle="true" reRender="value" />
      
       </h:selectOneMenu>
       <h:outputText id="details" value="#{v.value}" />
       </rich:column>
      </rich:listShuttle>
      


      When I select a value in the select component, I get the following message in the server's log

      No component found to process as 'ajaxSingle' for clientId
      


      ... and obviously neither the bean nor the component details are updated.



        • 1. Re: listShuttle and ajaxSingle problem
          ilya_shaikovsky

           

           <h:inputText value="#{items.label}">
           <a4j:support event="onblur" ajaxSingle="true"/>
           </h:inputText>
          


          this not works for me also.

          but this does:
           <rich:column>
           <a4j:region>
           <h:inputText value="#{items.label}">
           <a4j:support event="onblur" />
           </h:inputText>
           </a4j:region>
           </rich:column>
          

          https://jira.jboss.org/jira/browse/RF-8147
          created for additional investigations.


          • 2. Re: listShuttle and ajaxSingle problem
            pappy

            Hi

            It is true that your code no longer display the message in the server's log but that's not enough. Having your example modified as below

            <a4j:region id="region">
             <h:inputText id="edit" value="#{v.value}">
             <a4j:support id="change" event="onblur" [reRender="details"] />
             </h:inputText>
             <h:outputText id="details" value="#{v.value}" />
            </a4j:region>
            


            .. I expect to have the property "value" updated via its setValue method but that doesn't happen and obviously the component "details" remains unchanged



            • 3. Re: listShuttle and ajaxSingle problem
              ilya_shaikovsky

              thanks for update.. will consider it during issue investigation.

              • 4. Re: listShuttle and ajaxSingle problem
                pappy

                Issue is probably located in UIDataAdaptor at line 1096, there is no "else" if the key converter is null...

                I added the following rowKeyConverter to the listShuttle component and everything works for me:

                public Object getAsObject( FacesContext context, UIComponent component, String value )
                {
                 if( value == null ) {
                 return null;
                 }
                
                 final boolean target = value.startsWith( "t" );
                
                 if( target ) {
                 value = value.substring( 1 );
                 }
                
                 return new ListShuttleRowKey( value, !target );
                }
                
                public String getAsString( FacesContext context, UIComponent component, Object value )
                {
                 if( value == null ) {
                 return null;
                 }
                
                 return value.toString();
                }