This content has been marked as final.
Show 1 reply
-
1. Re: Updating a single row in a repeat?
sergeysmirnov Mar 26, 2007 5:45 PM (in response to dustismo)Yes, you cannot use #{} EL for id. Just forget about it.
What might be the way to go:
a:repeat has two useful attribute: rowKey and ajaxKeys. The first one, by default if you do not override it in data model, equals to number of row (Integer type).
ajaxKeys is a Set (java.util.Set) of rows that should be re-rendered. If ajaxKeys attribute equals null, just the whole table is re-rendered.
However, you can define it and only the referenced row will be updated.
So,<h:form id="myform"> <a:repeat id="accounts" var="account" ajaxKeys="#{accoundBean.rowsToUpdate}"> ..... <h:outputText id="email" value="#{account.email}" /> .... </a:repeat> <a:commandButton action="#{accountBean.update}" reRender="accounts:email" /> <h:form>
If getRowsToUpdate returns null, the whole table will be re-rendered. However, if you specify the Set in the accountBean.update method, for example, only the specified row(s) will be re-rendered