0

[Solved] Multiple selection of Treeitems

asked 2014-02-18 09:15:48 +0800

IngoB gravatar image IngoB flag of Germany
256 6

updated 2014-03-11 15:24:45 +0800

Hi,

i create a Tree with Treeitems and I want them all "checked". My tree has both attributes set ( multiple="true" checkmark="true" ) in my ZUL File.

ZUL File

<tree id="treView" vflex="true" hflex="true" multiple="true" checkmark="true">
                        <treecols>
                            <treecol label="1" />
                            <treecol label="2" />
                            <treecol label="3" />
                        </treecols>
                    </tree>

JAVA File

    treView.appendChild(new Treechildren());

    Treeitem ti1 = new Treeitem();
    ti1.setLabel("1");

    ti1.appendChild(new Treechildren());
    Treeitem ti11 = new Treeitem();
    ti11.setLabel("1.1");
    ti1.getTreechildren().appendChild(ti11);

    treView.getTreechildren().appendChild(ti1);

    for (Treeitem treeItem : treView.getItems()) {
        treeItem.setSelected(true);
    }

This gives an error "client error: Failed to mount: _multiple is not defined". The error is a http://i.imgur.com/CBCmooM.png (red box) in my browser with two buttons "reload"&"X". If i click on "reload", everything is checked, like it is supposed to be.

tl:dr; I want all items on a tree checked, without an error.

P.S.: I'm using Chrome 32.0.1700.107 / FF 27.0 and ZK 7.0.0


I created a fiddle to reproduce it. http://zkfiddle.org/sample/3tqq43h/18-Tree-sample (ZK Fiddle)

delete flag offensive retag edit

Comments

Ok, i solved it.

i had to invalidate the tree before i set it checked.

IngoB ( 2014-02-18 09:39:11 +0800 )edit

I post a bug here - http://tracker.zkoss.org/browse/ZK-2314

jumperchen ( 2014-05-30 10:49:37 +0800 )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
1 follower

RSS

Stats

Asked: 2014-02-18 09:15:48 +0800

Seen: 18 times

Last updated: Mar 11 '14

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