Avatar

Level 3

I have a list of items displayed in a table with just an ID, name and 'Edit' button and a subform with details about the selected item.  The backing schema has a  'selectedItem' place-holder as well as a list of items (the 'streams' node in the text below).  The script for the 'Edit' button successfully extracts the index of the selected row but I'm having trouble getting the detail data for that item to display in the edit subform.  The easiest approach would seem to be to set the subform binding to the selected row and remerge the data DOM and form DOM but that doesn't seem to do anything.  The .XDP file is coded to bind the subform as follows:

    <bind match="dataRef" ref="$.streams.waterbody[0]"/>

My script assigns the new binding value and calls remerge() as follows:

    subform.bind.ref = "$.streams.waterbody[" + rowIndex + "]";

    xfa.form.remerge();

where subform is the subform obtained from xfa.resolveNode.  The script completes but the subform is not bound to the selected row.  Attempting to use xfa.resolveNode to get a handle to the data row itself causes the script to fail but then I don't seem to be able to reference anything in the data DOM.  I have no trouble referencing the form DOM.  Any help would be appreciated.