Sunday, May 22, 2005

ADF - Dynamic rendering of UI irrespective of dataobjects

The following code in the view layer will render the dataobjects without any change in the view layer even though the view object gets re-constructed in the transaction.

<pre>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<c:forEach var="attributeLabel" items="${bindings.(voname).labelSet">
<th>
<c:out value="${attributeLable}" />
</th>
</c:forEach>
</tr>
<c:forEach var="Row" items="${bindings.(voname).rangeSet">
<tr>
<c:forEach var="attrValue" items="${Row.attributeValues}" >
<td>
<c:out value="${attrValue}" />
</td>
</c:forEach>
</tr>
</c:forEach>
</table>
</pre>

Basically the above code makes use of the labelSet and rangeSet properties of the VO object in the bindings and loop through them and print the same.

No comments: