AnsweredAssumed Answered

Component Generator vs. Selected Items

Question asked by jarrett on Apr 28, 2009
Latest reply on Apr 18, 2011 by joshijimit
I am having a hard time getting a component generator/ converter to display the correct information for multiple selects. Following this post http://forums.alfresco.com/en/viewtopic.php?f=4&t=11687 I was able to make a working component generator and converter (I think). The component generator creates value option pair for items in a drop down list for a multiple select.

This is what works:
The details page looks great, labels are shown and not the actual values
Drop down menus on the edit page work well, and show the labels and store the value

This is what fails:
When you select an item from the drop down and it is added to the "selected items" the value and not the label is shown. Once you leave edit mode the label is shown. In edit mode on values are shown in the "Selected Items" and not the labels.

From web-client-config-custom.xml my aspect:

   <config evaluator="aspect-name" condition="yg:taxGeography">
      <property-sheet>
         <separator name="sep2" display-label="Geography" component-generator="HeaderSeparatorGenerator" />
         <show-property name="yg:Geography" converter="ListOfValuesQueryConverter" component-generator="ListOfValuesQueryGenerator" />
      </property-sheet>
   </config>

From my model:
<!– The Constraint –>
      <constraint name="yg:CodeLabel" type="org.contezza.customConstraints.ListOfValuesQueryConstraint">
         <parameter name="allowedValues">
            <list></list>
         </parameter>
         <parameter name="caseSensitive"><value>true</value></parameter>
      </constraint>

<!– The Aspect –>
      <aspect name="yg:taxGeography">
         <title></title>
         <properties>      
            <property name="yg:Geography">
               <title>Geography</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <multiple>true</multiple>
               <constraints><constraint ref="yg:CodeLabel" /></constraints>
            </property>
         </properties>
      </aspect>

From my faces-config-custom.xml
<managed-bean>
        <description>Dropdown with lable and value</description>
        <managed-bean-name>ListOfValuesQueryGenerator</managed-bean-name>
        <managed-bean-class>org.contezza.customConstraints.ListOfValuesQueryGenerator</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

<managed-bean>
        <description>Dropdown with lable and value</description>
        <managed-bean-name>ListOfValuesQueryConverter</managed-bean-name>
        <managed-bean-class>org.contezza.customConstraints.ListOfValuesQueryConverter</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

Any help and insight is greatly appreciated.

Outcomes