0

[Solved] Zats does not get listbox with Template

asked 2015-11-27 16:33:03 +0800

jpboudreau gravatar image jpboudreau
18 3

updated 2015-11-27 20:07:31 +0800

Hey, I am trying to make test for my Zk 8 application with zats.

I have a .zul that looks like this :

<listbox id="listboxCat" mold="select" model="@load(vm.category)" selectedItem="@load(vm.selectedItem)">
        <template name="model" var="cat">
            <listitem label="@load(cat)" />
        </template>
</listbox>

and in my test I have something like this :

ComponentAgent listboxCat = page.query("#listboxCat");

But the listboxCat.size() always return 0. I tried to cast it to .as(Listbox.class), it still not work. I tried what it says on the wiki

desktop.queryAll("listbox > listitem").get(0).as(SelectAgent.class).select();

It throw a null pointer exception because it doesn't fin any listitem.

Is there a bug with zats and template model?

Thanks

EDIT : It works if I do this :

                    <listbox id="listboxCat" style="height: 30px;" mold="select">
                            <listitem label="1" />
                            <listitem label="2" />
                            <listitem label="3" />
                            <listitem label="4" />
                    </listbox>

It's not what I want thought...

EDIT 2: If my model is a list of string instead of business object, it works. Is there some limitation there?

Edit 3: It was a big code 18..

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
3 followers

RSS

Stats

Asked: 2015-11-27 16:33:03 +0800

Seen: 30 times

Last updated: Nov 27 '15

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