try to use a latest myfaces release. We found a lot of bugs in the
datatable/sortheader stuff since 1.0.9. If you plan to use input
fields inside a datatable you should definitly use 1.1.0 or 1.1.1RC3

2005/10/21, Jecker Frédéric (LFR) <[EMAIL PROTECTED]>:
>
> Hello,
>
> This problem is now solved (the version explained below is working)
> (..but don't ask me why, there's some kind of magic around !)
>
> Rgds
>
> FJ
>
>  ________________________________
>  De : Jecker Frédéric (LFR) [mailto:[EMAIL PROTECTED]
> Envoyé : vendredi 21 octobre 2005 11:02
> À : [email protected]
> Objet : DataTable Sorting not working
>
>
>
>
> Hello,
>
> I have the following problem:
> I have a page displaying a dataTable that can be modified by the users
> (add/update/delete row) this works fine.
> Now I tried to implement sortable headers on my table.
> To do this I added the following properties
> to the bean managing the table :
>
> private String sort="ident";
> private boolean ascending=false;
>
> With their getters/setters
>
> public String getSort(){}
> public void setSort(String sortColumn){}
> public boolean isAscending(){}
> public void setAscending(boolean ascending) {}
>
> I also modified my dataTable, adding the sortColum and sortAscending
> properties:
> <x:dataTable
>   var="art"
>   binding="#{GabaritManager.articlesList}"
>   value="#{GabaritManager.articles}"
>   sortAscending="#{GabaritManager.sort}"
>   sortColumn="#{GabaritManager.ascending}"
> >
>   <h:column>
>     <f:facet name="header">
>       <x:commandSortHeader columnName="ident" arrow="true">
>         <h:outputText value="Ident"/>
>       </x:commandSortHeader>
>     </f:facet>
>     <h:outputText value="#{art.ident}"/>
> </h:column>
> [...]
>
> Finally I updated the method returning the table value to take the sorting
> into account
> Now when i load the form i always have the following error:
>
> 2005-10-21 10:54:33,830 [http-8080-Processor23] ERROR
> org.apache.myfaces.renderkit.html.HtmlGridRenderer  -
> Exception while rendering children of panel-grid.
> java.lang.ClassCastException
>  at
> org.apache.myfaces.component.html.ext.HtmlDataTable.getSortColumn(HtmlDataTable.java:685)
>
> I tried a lot of things but none worked (like changing the ascending
> property to String)
>
> Btw, i'm using myfaces 1.0.9 (bundled with MyEclipseIDE)
>
> Thanks for your help
>
> FJ
>


--
Mathias

Reply via email to