0

How to receive onOpen event of listgroup

asked 2017-05-16 14:04:47 +0000

scottz gravatar image scottz
1

I've got a large amount of data for a listbox, and the objects are relatively slow to create, so I'm trying to send limited numbers of the objects to the model at a time. The data is grouped (and the user can select four different groupings). I'm looking to be notified when the groups are collapsed so that I know when to go get more data from the DB and add the records to the model.

            <template name="model:group">
            <zk if="${vm.selectedGroupBy == 'Date/Time Called'}">
                <listgroup>
                    <listcell onOpen="@command('toggleGroup')">
                        <label
                            value="@load(each.logDate)"
                            style="font-weight:bold;"/>
                    </listcell>
                </listgroup>
            </zk>
            <zk if="${vm.selectedGroupBy == 'Agency'}">
                <listgroup label="@bind(each.agencyName)"
                    style="font-weight:bold;"  onOpen="@command('toggleGroup')" />
            </zk>
            <zk if="${vm.selectedGroupBy eq 'Location'}">
                <listgroup label="@bind(each.location)" style="font-weight:bold;"  onOpen="@command('toggleGroup')" />
            </zk>
            <zk if="${vm.selectedGroupBy eq 'Type of Call'}">
                <listgroup label="@bind(each.type)"
                    style="font-weight:bold;"  onOpen="@command('toggleGroup')" />
            </zk>
        </template>

At the moment, the toggleGroup method is not being called.

@Command
public void toggleGroup(OpenEvent oe) {

    System.out.println("toggleGroup");

}

How can I set things up so that I can receive notification and be able to expand the dataset when needed?

delete flag offensive retag edit

Comments

without seeing a working example I can only ask: do all the groups fail to send the onOpen event? or only the first one 'Date/Time Called' since here the onOpen event is not at the <listgroup> but at the <listcell> element instead. If possible share a runnable example e.g. on http://zkfiddle.org/

cor3000 ( 2017-05-22 06:22:12 +0000 )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: 2017-05-16 14:04:47 +0000

Seen: 16 times

Last updated: May 16

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