cancel
Showing results for 
Search instead for 
Did you mean: 

sort problem with column, please help

tsongwei3
Champ in-the-making
Champ in-the-making
I added a column in Browse.jsp

<a:column id="col13-2" style="text-align:left">
<f:facet name="header">
<a:sortLink id="col132-sort" label="#{exmsg.active}" value="my:active" styleClass="header"/>
</f:facet>
<h:outputText id="col13-2-t-txt" value="on" rendered='#{r["my:active"]=="true"}' />
<h:outputText id="col13-2-f-txt" value="of" rendered='#{r["my:active"]=="false"}' />
<h:outputText id="col13-2-n-txt" value='' rendered='#{r["my:active"]==null}' />

</a:column>

The result works fine except the sorting function.
When I click on the column header for sorting, it seems to sort randomly.

the property is defined as following:

   <aspects>
      <aspect name="my:myType">
         <title>My type Storable</title>
         <properties>
            
            <property name="my:active">
               <type>d:boolean</type>
               <mandatory>true</mandatory>
               <default>false</default>
            </property>   
            
         </properties>
      </aspect>
   </aspects>


Please help me solving the sorting issue.
Thanks
1 REPLY 1

gavinc
Champ in-the-making
Champ in-the-making
This may be due to the property value being null in the database.

If you have adeed a boolean type property in the model existing nodes may not have a value yet and thus it's set to 'null'.

Therefore the sort maybe batching all the nodes with null together, then true, then false.