0

Bandbox inside a loop

asked 2015-02-03 11:33:20 +0800

vibinbobyjoseph gravatar image vibinbobyjoseph
1

Hello,

I have a set of column headers for which I am trying to create bandbox(s). Pasted below is the part of the zul file code that I am trying to run. The demo on zk website uses the id of the bandbox element to close it on select ( onSelect="bd.close()". ). But in my case, the id of each bandbox has to be dynamically created as they have to be unique and this id is referred in the onSelect="dynamicUniqueId.close()". I tried many ways but none of them seem to work. The below shown code gives me an error.

Error: Caused by: bsh.EvalError: Sourced file: inline evaluation of: `` ${header.sortCol}.close();'' : Attempt to access property on undefined variable or class name

Zul Code:

<columns visible="true" children="@load(vm.headers)"> 
                            <template name="children" var="header">
                                <column label="@load(header.label)" onSort="@command('onSort', sortCol=header.sortCol)"
                                    sort="auto(null)">
                                    <separator/>

                                    <bandbox width="100%" visible="@bind(vm.columnShown(header.label))" id="@bind(vm.dropDownItemMap[header.sortCol])" mold="rounded" autodrop="true">
                                        <bandpopup>
                                            <listbox height="200px" width="300px" mold="paging" autopaging="true"
                                                     onSelect="@bind(vm.dropDownSelection[header.sortCol]).value=self.selectedItem.label; @bind(vm.dropDownItemMap[header.sortCol]).close();"
                                                     model="@load(vm.dropDownItemMap[header.sortCol])"
                                                     selectedItem="@bind(vm.dropDownSelection[header.sortCol])">
                                                <template name="model">
                                                    <listitem label="@load(each.name)" value="@load(each)"/>
                                                </template>
                                            </listbox>
                                        </bandpopup>
                                    </bandbox>

                                <separator visible="@bind(!vm.columnShown(header.label))" style="height:22px;"/>
                                </column>
                            </template>
                        </columns>
delete flag offensive retag edit
Be the first one to answer this question!
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
2 followers

RSS

Stats

Asked: 2015-02-03 11:33:20 +0800

Seen: 10 times

Last updated: Feb 03 '15

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