myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "techie techie" <techie_tec...@techie.com>
Subject sortHeader Component issue
Date Mon, 13 Jun 2005 15:03:40 GMT
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


Mime
View raw message