0

ZK Listbox Dynamic Template

asked 2014-05-26 08:31:37 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

I followed this link and used as follows

                                        <listbox sclass="mylist" 
                                            selectedItem="@bind(vm.selectedLineItem)"
                                            model="@bind(vm.transDetails)  @template(vm.type='foo'?'template1':'template2')"  
                                            emptyMessage="No record found for the given search condition.">

But showing error as follows image description

Run time error as follows

org.zkoss.util.IllegalSyntaxException: Must specify a template for model of <listbox izpdwe=""> at [file:/F:/MyDocuments/Java/ZK7LabSystem/LabSystem/LabSystem/src/main/webapp/zk/billing/searchlineitem.zul, line:352] at org.zkoss.bind.impl.AnnotateBinderHelper.parseTemplate(AnnotateBinderHelper.java:781) at org.zkoss.bind.impl.AnnotateBinderHelper.processPropertyBindings(AnnotateBinderHelper.java:230) at org.zkoss.bind.impl.AnnotateBinderHelper.processComponentBindings0(AnnotateBinderHelper.java:113)

delete flag offensive retag edit

Comments

Senti, maybe stupid to ask but can you write your whole listbox, inclusif the templates?

chillworld ( 2014-05-26 08:55:18 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-05-26 09:12:00 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

actually this is solved, there are some problems in ZL (Bug), I just resolved as follows

model="@bind(vm.transDetails) @template(vm.listlayout)"

and changed the template option on button click. On button click the variable is changed to template1 and template2

link publish delete flag offensive edit
0

answered 2014-05-26 21:21:10 +0800

khcyt gravatar image khcyt
216 1 1

Hello Sentil, I suggest you write vm.type eq 'foo'. '=' is an assignment and can not be evaluated as the ternary operator.

Kai

link publish delete flag offensive edit

Comments

Thank you !

Senthilchettyin ( 2014-05-26 21:37:37 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-05-26 08:31:37 +0800

Seen: 24 times

Last updated: May 26 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More