-
1. Re: extendedDataTable migration to RF4 (a4j:support and f:setPropertyActionListener)
scummbar Sep 28, 2011 3:15 PM (in response to scummbar)Nevermind.. it was quite easy. For anyone with the same problem (i doubt it) i leave my solution. Trivial stuff.
in the page:
<rich:extendedDataTable id="table" style="width:300px;" rows="20"
selection="#{bean.
seleccionados}" var="item" value="#{listado}" selectionMode="single"
rowClasses="odd-row, even-row" styleClass="stable">
<a4j:ajax execute="@form"
event="selectionchange"
listener="#{bean.selectionListener}" render="@all" />
...in the Managed Bean:
public void selectionListener(AjaxBehaviorEvent event) {
UIExtendedDataTable dataTable = (UIExtendedDataTable) event.getComponent();
Object originalKey = dataTable.getRowKey();
for (Object selectionKey : entidad) {
dataTable.setRowKey(selectionKey);
if (dataTable.isRowAvailable()) {
idSeleccionado = ((Entidad)dataTable.getRowData()).getId();
onSeleccionEntidadId(idSeleccionado);
}
}
dataTable.setRowKey(originalKey);
}Cheers!