ZK - Adding component to Treeitem depending on model content

So, I want to add a specific component (either Checkbox or Textbox) depending on the AttType field of my current node. My zul file looks like this:\[code\]<tree id="permissionTree" width="100%" model="@bind(vm.treeModel)" style="text-align:left;"> <treecols> <treecol label="Item" width="400px" /> <treecol label="Wert" /> </treecols> <template name="model" var="node"> <treeitem> <treerow> <treecell label="@load(node.data.name)" /> <treecell> HERE COMPONENT DEPENDING ON node.data.AttType </treecell> </treerow> </treeitem> </template> </tree>\[/code\]How can I accomplish this? Oh and I want the Textbox/Checkbox value to be bound to my model as a String, that would be pretty nice.Thanks for any suggestions.Edit: I made a little "workaround" for myself. Since I have only 3 possible input types, I just defined them hard-coded:\[code\]<tree id="permissionTree" width="100%" model="@bind(vm.treeModel)" style="text-align:left;"> <treecols> <treecol label="Item" /> <treecol label="Wert" /> </treecols> <template name="model" var="node"> <treeitem open="@bind(node.open)" onClick="@command('expandNode', item=node)"> <treerow> <treecell label="@load(node.data.name)" /> <treecell> <textbox visible="@load(node.data.isTextbox)" value="http://stackoverflow.com/questions/11492278/@bind(node.data.value)" /> <textbox visible="@load(node.data.isTextarea)" rows="6" width="300px" value="http://stackoverflow.com/questions/11492278/@bind(node.data.value)" /> <checkbox visible="@load(node.data.isCheckbox)" checked="@bind(node.data.checkboxValue)" /> </treecell> </treerow> </treeitem> </template> </tree>\[/code\]And in the constructor of a TreeNode I set the isTextbox/isTextarea/isCheckbox values according to the type. This way the model binding still works :)
 
Top