PDA

View Full Version : If using $path{somepath}, is datapath.UpdateData needed?


tspratt
02-18-2004, 06:02 PM
The documents imply that when an attribute uses the syntax,
 value="$path{ somexpath }",
the dataset update is automatic.

Does this mean that it is unnecessary to use the datapath.UpdateData() method in this situation?

And an a couple add'l questions on UpdateData: Must it be called on each datapath binding that changes?

If it is called on the root node of the datapath, will all edits be saved?

Thanks,
Tracy

antun
02-18-2004, 07:52 PM
You only need to call updateData() if the data has changed in the view that is bound, and you want the dataset that it is bound from to reflect that.

For example:


<dataset name="foo">
<mynode smelly="poo" />
</dataset>

<inputtext datapath="foo:/mynode/@smelly" />


If you edit the text in the inputtext field, then the dataset it is bound to won't update until you call updateData() on the inputtext field (in LPS 2.0). In 1.0.x, it was bound constantly, but that turned out to be more of a problem than a convenience.

-Antun

antun
02-19-2004, 10:16 AM
A minor correction:

It wasn't bound constantly in 1.0.x; updateData was called retrieveData in 1.0.x.

I wrote:
In 1.0.x, it was bound constantly...