Good Morning!
Is it possible to reRender only 1 specific row of rich:dataTable?
I have a rich:dataTable and, when I do something that I´m sure only 1 row has changed, I need to reRednder only this row, not the entire table. Is it possible? How?
XHTML:
<rich:dataTable id="myTable" value="#{bean.table}" var="me">
<rich:column>
<h:outputText value="#{me.id}" />
</rich:column>
<rich:column>
<h:outputText value="#{me.valueOne}" />
</rich:column>
<rich:column>
<h:outputText value="#{me.valueTwo}" />
</rich:column>
</rich:dataTable>
<some:tag.... reRender="??????" action="bean.example" />
Java:
public void example{
// Do something that affects to the row selected
}
THANK YOU VERY MUCH.
Yes , it is possible . You have to specify the followings things:
reRenderattribute of the tags that can invoke MBean methodajaxKeysattribute of therich:dataTable.The
ajaxKeysattribute is bound toSet <Integer>Object which holds the row numbers to be updated.For example , suppose you want to invoke a Mbean method using
a4j:commandButtonand want to render a particular row and column after the action finishes . You can use the following :Inside the
bean.someAction(), you add the row number that you want to update to therowsToUpdateinteger set: