* over to the actual binding-children.
*/
public void doLoad(Widget frmModel, JXPathContext jxpc)
throws BindingException {
// Find the repeater
Repeater repeater = (Repeater) selectWidget(frmModel, this.repeaterId);
if (repeater == null) {
throw new BindingException("The repeater with the ID [" + this.repeaterId
+ "] referenced in the binding does not exist in the form definition.");
}
repeater.clear();
Pointer ptr = jxpc.getPointer(this.repeaterPath);
if (ptr.getNode() != null) {
// There are some nodes to load from
final int initialSize = repeater.getSize();
// build a jxpath iterator for pointers
JXPathContext repeaterContext = jxpc.getRelativeContext(ptr);
Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);
//iterate through it
int currentRow = 0;
while (rowPointers.hasNext()) {
// create a new row, take that as the frmModelSubContext
Repeater.RepeaterRow thisRow;
if (currentRow < initialSize) {
thisRow = repeater.getRow(currentRow++);
} else {
thisRow = repeater.addRow();
}
// make a jxpath ObjectModelSubcontext on the iterated element
Pointer jxp = (Pointer)rowPointers.next();
JXPathContext rowContext = repeaterContext.getRelativeContext(jxp);
// hand it over to children