cancel
Showing results for 
Search instead for 
Did you mean: 

<h:datatable> doesn´t sort content

cybermakoki
Champ in-the-making
Champ in-the-making
Hi!

To use checkboxes in the browse.jsp content list I have been forced to use the <h:dataTable> tag instead of <a:richlist> tag.

This is my code:

<h:dataTable value="#{BrowseBean.content}"  var="r2" styleClass="recordSet"
rowClasses="recordSetRow, recordSetRowAlt" headerClass="recordSetHeader" width="100%" rendered="#{not empty BrowseBean.content}">
   

By default, I have sorted the content by "created" property:

<config evaluator="string-compare" condition="Views">
   <views>
      <view-defaults>
         <browse>
            <view>details</view>
            <page-size>            
            <details>25</details>            
            </page-size>
            <sort-column>created</sort-column>
            <sort-direction>descending</sort-direction>
         </browse>
      </view-defaults>
   </views>
   </config>

with <a:richlist> the content is sorted correctly, but with <h:dataTable> the content is sorted ascending instead of descending!

Anybody has encountered the same problem? what can I do? Smiley Sad
4 REPLIES 4

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Using <h:dataTable is like using cannon on a pigen . I do not think that anyone has done this, because is a bit crazy ,no offance .

you are to break the problem of checkboxes. even then you will see that with no ajax this makes no scence too.
all you have to do is:
put checkbox, write javascript to keep track of selected nodes something like :

<input id="nodeid" type="checkbox" title="TextF" onclick="rem('nodeId',this)" value="false"> 

on submit form connect bean and selected nodes .
you would need some jquery for this, and this is all a bit knowledge a bit fun and it is done.

cybermakoki
Champ in-the-making
Champ in-the-making
Thank you for your idea but i don't have time to change everything now Smiley Sad

I'll try to use jquery to resolve this problem  later Smiley Happy

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
post code when you finish it, just to see please.

cybermakoki
Champ in-the-making
Champ in-the-making
If I finally implement that solution be sure that I'll post it Smiley Happy