data_app-$8.lzx
<canvas height="400" width="100%" bgcolor="#D4D0C8">
<dataset name="dset" src="resources/phonebook.xml"/>
<simplelayout axis="y"/>
<view>
<simplelayout axis="y"/>
<text onclick="parent.newContact.setAttribute('visible', !parent.newContact.visible);">New Entry...</text>
<view name="newContact" datapath="new:/contact" visible="false" x="20" height="120">
<text y="10">First Name:</text>
<edittext name="firstName" datapath="@firstName" x="80" y="10"/>
<text y="35">Last Name:</text>
<edittext name="lastName" datapath="@lastName" x="80" y="35"/>
<text y="60">Phone:</text>
<edittext name="phone" datapath="@phone" x="80" y="60"/>
<text y="85">Email:</text>
<edittext name="email" datapath="@email" x="80" y="85"/>
<button width="80" x="200" y="10">Add
<handler name="onclick">
parent.datapath.updateData();
var dp=canvas.datasets.dset.getPointer();
dp.selectChild();
dp.addNodeFromPointer(parent.datapath);
parent.setAttribute('datapath', "new:/contact");
</handler>
</button>
</view>
</view>
<view datapath="dset:/phonebook/contact">
<simplelayout axis="y"/>
<view name="list" onclick="parent.updateContact.setAttribute('visible', !parent.updateContact.visible);">
<simplelayout axis="x"/>
<text datapath="@firstName"/>
<text datapath="@lastName"/>
<text datapath="@phone"/>
<text datapath="@email"/>
</view>
<view name="updateContact" visible="false" x="20" height="120">
<text y="10">First Name:</text>
<edittext name="firstName" datapath="@firstName" x="80" y="10"/>
<text y="35">Last Name:</text>
<edittext name="lastName" datapath="@lastName" x="80" y="35"/>
<text y="60">Phone:</text>
<edittext name="phone" datapath="@phone" x="80" y="60"/>
<text y="85">Email:</text>
<edittext name="email" datapath="@email" x="80" y="85"/>
<button width="80" x="200" y="10">Update
<handler name="onclick">
parent.parent.datapath.updateData();
</handler>
</button>
<button width="80" x="200" y="40">Delete
<handler name="onclick">
parent.parent.datapath.deleteNode();
</handler>
</button>
</view>
</view>
</canvas>
Cross References
Named Instances