datapointer-creating-node.lzx
<canvas debug="true" width="100%">
<include href="lz/datacombobox.lzx"/>
<dataset name="ds" src="./shareddata/contacts_full.xml"/>
<datapointer name="dp"/>
<simplelayout/>
<list id="mylist" datapath="ds:/addressbook/contacts" height="100" width="150">
<textlistitem datapath="person" text="$path{'@email'}" value="$path{'position()'}"/>
</list>
<button text="Print total person nodes">
<handler name="onclick">
dp.setAttribute("xpath","ds:/addressbook/contacts");
Debug.debug("total child nodes %w", dp.getNodeCount() );
</handler>
</button>
<button text="Add 'fflinestone@cartoon.com' item">
<handler name="onclick">
dp.setAttribute("xpath","ds:/addressbook/contacts");
var newnode = dp.addNode('person', 'Fred Flinestone', {'email':'fflinestone@cartoon.com'})
Debug.debug("newnode= = %w", newnode);
</handler>
</button>
</canvas>
Cross References
Includes
Named Instances
- <list id="mylist">
- <datapointer name="dp">
- <dataset name="ds">