NewProjectWindow.lzx
<library>
<class name="NewProjectWindow" extends="window" title="<b>New Project<b>" align="center" valign="middle" allowdrag="false" width="450" height="380" focustrap="true">
<node name="i18n" datapath="i18nDS:/app/project/create">
<attribute name="newProjectMessage" type="string" value="$path{'newProjectMessage/text()'}"/>
<attribute name="missingParameters" type="string" value="$path{'missingParameters/text()'}"/>
</node>
<ServiceConnector name="createProjectConn" form="$once{parent}">
<method name="handleResult" args="message">
form.searchSubnodes("name", "messageBox").setAttribute('text', message);
</method>
</ServiceConnector>
<handler name="onvisible">
if (this.visible) {
lz.ModeManager.makeModal(this);
lz.Focus.setFocus(this.searchSubnodes("name", "projectTitle"));
} else {
lz.Focus.setFocus(null);
lz.ModeManager.release( this )
}
</handler>
<handler name="onmouseout">
lz.Cursor.showHandCursor(true);
</handler>
<handler name="onmouseover">
lz.Cursor.showHandCursor(false);
</handler>
<method name="collectValues">
var values = new Array();
values['name'] = parent.searchSubnodes("name", "projectName").text;
values['description'] = parent.searchSubnodes("name", "description").text;
return values;
</method>
<method name="reset">
parent.searchSubnodes("name", "projectName").setAttribute('text', '');
parent.searchSubnodes("name", "description").setAttribute('text', '');
this.setAttribute("visible", false);
</method>
<simplelayout axis="y" spacing="20"/>
<BorderedBox name="messageBox" align="center" height="30" width="${parent.width-60}" borderColor="#777777" bgcolor="#cccccc" borderSize="2" visible="true" clip="true">
<method name="setText" args="t">
if (t.length > 0) {
this.textField.setAttribute('text', t);
} else {
this.textField.setAttribute('text', classroot.i18n.newProjectMessage);
}
</method>
<text name="textField" align="center" fgcolor="#2c4c62" fontsize="12" datapath="i18nDS:/app/project/create/newProjectMessage/text()"/>
</BorderedBox>
<view align="center">
<simplelayout axis="y" spacing="5"/>
<text fontsize="10" fontstyle="bold">Project Title</text>
<edittext name="projectName" width="300"/>
<text fontsize="10"><b>Project Description</b></text>
<BorderedBox height="140" width="400" bgcolor="#d8ebff" borderColor="#777777">
<inputtext name="description" width="${parent.innerWidth}" height="${parent.innerHeight}" multiline="true">
</inputtext>
</BorderedBox>
</view>
<view align="center">
<simplelayout axis="x" spacing="100"/>
<button datapath="i18nDS:/app/project/create/save/text()" onclick="classroot.createProjectConn.callService()"/>
<button datapath="i18nDS:/app/project/create/cancel/text()" onclick="classroot.reset()"/>
</view>
</class>
</library>