People.lzx
<library>
<class name="People" extends="view">
<attribute name="userId" type="string" value="$path{'id/text()'}"/>
<attribute name="email" type="string" value="$path{'email/text()'}"/>
<attribute name="login" type="string" value="$path{'login/text()'}"/>
<attribute name="realName" type="string" value="$path{'realName/text()'}"/>
<attribute name="lastLogin" type="string" value="$path{'lastLogin/text()'}"/>
<attribute name="showControls" type="boolean" value="false
"/>
<handler name="ondata">
if (this.login == 'laszlo') {
this.setAttribute('showControls', false);
} else {
this.setAttribute('showControls', true);
}
</handler>
<method name="deleteUser">
canvas.services.deleteUser.ontrigger.sendEvent(this);
</method>
<method name="collectValues">
var values = new Array();
values['login'] = this.login;
return values;
</method>
<simplelayout axis="y" spacing="2"/>
<text fontsize="9" fontstyle="bold" text="${'Login: ' + classroot.login}"/>
<text fontsize="9" fontstyle="bold" text="${classroot.realName}"/>
<text fontsize="9" width="$once{parent.width}" text="${classroot.email}"/>
<text fontsize="9" width="$once{parent.width}" text="${classroot.lastLogin}"/>
<view width="${parent.width-10}" height="2" bgcolor="#030109"/>
<view options="ignorelayout" align="right" visible="${classroot.showControls}">
<simplelayout axis="x" spacing="5"/>
<text fontsize="9" onclick="createUserForm.loadUser(classroot)"><u>Edit</u></text>
<text fontsize="9" onclick="classroot.deleteUser()"><u>Delete</u></text>
</view>
</class>
</library>
Cross References
Classes
- <class name="People" extends="view">