Dynamic DataTable in ManagedBean FilterBy and SortBy problem

UI Components for JSF
Post Reply
pablovilas
Posts: 1
Joined: 10 Nov 2011, 21:27

14 Nov 2011, 14:44

Hello,

Trying to enable filtering and sortering dynnamically in the managed bean doesn´t work for me. This is my code:

Managed Bean

Code: Select all

Column col = (Column) application.createComponent(Column.COMPONENT_TYPE);
col.setHeaderText(atr.getNombreVisible());
HtmlOutputText text = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
ValueExpression el = application.getExpressionFactory().createValueExpression(FacesContext.getCurrentInstance().getELContext(),"#{articulo.codigo}", String.class);
text.setValueExpression("value", el);
col.getChildren().add(text);
col.setFilterBy(el);
col.setSortBy(el);
tabla.getChildren().add(col);
Page

Code: Select all

<p:dataTable var="articulo" id="idTabla" binding="#{exploradorBean.tabla}"
			paginator="true" rows="20"
			paginatorPosition="bottom"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="20,25,50" selectionMode="single"
			selection="#{exploradorBean.seleccionado}" rowKey="#{articulo.id}"
			lazy="false">
</p:dataTable>
I´m using Primefaces 3.0M3. Thank you very muçh.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests