-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a problem with conditional templates and GroupModel
<grid id="theGrid" model="@bind(vm.myObjectViewModel) @template(not empty vmsgs ? 'templateA' : 'templateB')" emptyMessage="No data">
<columns>
<column width="50%" label="Description" sort="auto"/>
<column width="50%" label="Value"/>
</columns>
<!--
<template name="model:group">
<group label="whatever"/>
</template>-->
<template name="templateA:group">
<group label="Group A"/>
</template>
<template name="templateB:group">
<group label="Group B"/>
</template>
<template name="templateA" var="a">
<row>
<label value="@load(a.description)"/>
<label value="@load(a.value)" />
</row>
</template>
<template name="templateB" var="b">
<row>
<label value="@load(b.description)" style="font-size: 14pt; color: red;"/>
<label value="@load(b.value)"/>
</row>
</template></grid>
Property 'description' not found on type java.lang.String at [file:/C:/Oracle/Middleware/userprojects/domains/dev/servers/Development1/tmp/WL_user/myapp/806lrv/war/myobjectview.zul, line:36]
For some reason the selected template is also being used by zkoss for getting/setting the group name. Neither of my :group templates are working ,and even it doesn't work if I put in the "default" group template "model:group" (currently commented out)
The object being loaded is "MyObject" which has the following properties:
String description BigDecimal value
Any ideas?
@Zk Please check this out. Suspect bug here.
http://zkfiddle.org/sample/23op11h/4-gridgroup-dynamic-template-group-header
Greetz chill.
removed the @template('model:group') doesn't make sense. Then the list looks correct. (or am I missing something) @Chill: http://zkfiddle.org/sample/23op11h/6-gridgroup-dynamic-template-group-header
@tisaksen: your findings look like a bug I check if I can simplify and post a bug http://zkfiddle.org/sample/23op11h/8-gridgroup-dynamic-template-group-header
I posted the Bug: http://tracker.zkoss.org/browse/ZK-2555 together with a simpler way to reproduce the issue and a patch for the org.zkoss.bind.impl.BindRowRenderer
class
@Cor I know it doesn't make sense but was to simplify it. (was thinking to point out to the header first because the name of template didn't work either)
Greetz chill.
Asked: 2014-12-08 12:36:35 +0800
Seen: 33 times
Last updated: Dec 09 '14