Initial attemptBind the datatable to a
<t:dataTable id="someTable"
...
value="#{yourBackingBean.list}"
binding="#{yourBackingBean.someTable}">
...
<t:column>
<f:facet name="header" />
<h:outputText value="#{yourBackingBean.someValue}" />
</t:column>
...
In your backing bean, query the
class YourBackingBean {
private UIData someTable;
public void setSomeTable(UIData someTable) {
this.someTable = someTable;
}
public UIData getSomeTable() {
return someTable;
}
public List<YourRowData> getList() {
...
}
public String getSomeValue() {
final YourRowData row = (YourRowData) someTable.getRowData();
...
}
}
Problems with session-scoped backing beansIf your backing bean is session-scoped, you may get problems with JSF ID generation. I recognized this when I was working in a Spring application, accessing a datatable row as described above and loading the page twice. I worked around this by creating a second, request-scoped bean which I access from the Facelet/JSP instead. This bean gets the model, i.e. the YourBackingBean instance, injected by Spring so that I can query its data from there. |
Knowledge Base Game Development
Personal |
| Page last modified on July 10, 2008, at 08:58 PM |


