myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrique Medina <e.medin...@gmail.com>
Subject Re: dinamic order of rendering of columns in data table
Date Tue, 28 Jun 2005 14:27:01 GMT
Sorry, the Java Code should be this:

public DataModel getListDataModel()
{
    // Get the collection.
    List mylist = DoSomethingToGetTheListMethod();

    // Order the collection (maybe using a Comparator).
    Collections.sort(mylist, new ComparatorIfApplicable());

    return new ListDataModel(mylist);
}


2005/6/28, Enrique Medina <e.medina.m@gmail.com>:
> Hi Claudio,
> 
> Whay not just use the Collections.sort Java mechanism just before
> passing the collection to your DataModel? For example:
> 
> JSP PAGE:
> 
> <x:dataTable value="#{bean.listDataModel}" ...>
> 
> JAVA CLASS:
> 
> public List getListDataModel()
> {
>     // Get the collection.
>     List mylist = DoSomethingToGetTheListMethod();
> 
>     // Order the collection (maybe using a Comparator).
>     Collections.sort(mylist, new ComparatorIfApplicable());
> 
>     return mylist;
> }
> 
> 2005/6/28, Claudio Tamietto <c.tamietto@poker.it>:
> >
> > for dynamic rendering i mean this :
> > I have a table A with columns 1,2,3,4,5
> >
> > the user xx want to see the columns in  this order 3,1,5
> > ands the user yy want to see the columns in this order  2,3,4.
> >
> > I don't want to have two jsp but only one where i can configure the order of
> > rendering of the colums.
> >
> >
> > ----- Original Message -----
> > From: Jesse Alexander (KBSA 21)
> > To: MyFaces Discussion
> > Sent: Tuesday, June 28, 2005 4:01 PM
> > Subject: RE: dinamic order of rendering of columns in data table
> >
> >
> > What do you mean by dynamic rendering?
> >
> > Alexander
> > (che cosa vuoi fare?)
> >
> >
> >
> >  ________________________________
> >  From: Claudio Tamietto [mailto:c.tamietto@poker.it]
> > Sent: Tuesday, June 28, 2005 3:57 PM
> > To: MyFaces Discussion
> > Subject: dinamic order of rendering of columns in data table
> >
> >
> >
> > is it possibile rendering the columns of a table in a dinamic way  or i have
> > to create a new component and subclass it ?
>

Mime
View raw message