4 Replies Latest reply on Nov 16, 2012 8:35 AM by neikius

    rich:autocomplete in table layout : selection problems

    jerarckill

      Hello everybody,

       

      In the scope of a proof of concept with JSF2 and Richfaces 4, I am using the <rich:autocomplete> component and I have some problems making it work the way I want.

       

      I am trying to use the component in "table layout mode". 
      In this mode, I can define potentially multiple columns to display.

      The problem is that the columns I display are not forcibly the ones I want to see selected when I click on a value.

       

      Example: I display a translated label of each element in the list whereas, when clicking, I would want to select the internal value I give to the element.

       

      <rich:autocomplete mode="client" showButton="true" layout="table" autocompleteList="#{workflowDefinitions}"

           fetchValue="#{wfDefinition.value}" var="wfDefinition" value="#{multiCriteriaBean.basic.workflowDefinition}">

           <f:converter converterId="optionDescriptor"></f:converter>

           <rich:column>

                <h:outputText value="#{wfDefinition.label}"/>

                </rich:column>

      </rich:autocomplete>

       

      This will display the value and not the label in the inputField part of the autocomplete component okay, but this value then displayed is not equal to the one displayed in the dropdown just below, making it very hard to use the component.

       

       

      Couldn't we think of an improvement of the <rich:autocomplete> component where:

       

      • FetchValue would point to the value to select and send to the backing bean;
      • DisplayedValue: a new attribute displaying which part of the selected component we display in the inputField and use to perform the search (suggestion mode).

       

      thank you all for your attention and remarks,

       

      Jérôme Jadoulle