You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by techie techie <te...@techie.com> on 2005/06/13 17:03:40 UTC

sortHeader Component issue

I was just trying learn sortHeader Component. But got a doubt about its flow.
Below is code for ready reference...
  
use in JSP:
------------
<x:dataTable 
  var="car"
  value="#{list.cars}"
  sortColumn="#{list.sort}"
  sortAscending="#{list.ascending}"
  preserveDataModel="true"
  preserveSort="true">

 <f:facet name="header">
     <h:outputText value="(header table)"  />
 </f:facet>
 <f:facet name="footer">
     <h:outputText value="(footer table)"  />
 </f:facet>
 <h:column>
   <f:facet name="header">
     <x:commandSortHeader columnName="type" arrow="true">
        <h:outputText value="#{example_messages['sort_cartype']}" />
     </x:commandSortHeader>
   </f:facet>
   
   .........
   
   in managed bean list(SortableList): 
   getter/setter are there for sort and ascending atrribute
   And sort() method which uses these attributes to sort the list.
   
   
   
   in HtmlCommandSortHeader component class there is :
   
       public void broadcast(FacesEvent event) throws AbortProcessingException
       {
        ..................
        dataTable.setSortColumn(getColumnName());
        dataTable.setSortAscending(true);
                       
       }
  
  Now question is: 
  In broadcast method, dataTable attribute are set based on the header clicked.And we are 
  sorting based on "list" bean's sort/ascending attribute. 
  How "list" bean properties are updated? Or say how datatable attribute update will result in
  updation of bean property?
  
Thanks,


-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm