Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:30:20+00:00 2026-06-07T23:30:20+00:00

I’m fighting with this one for quite some time now. I have my TreeitemRenderer

  • 0

I’m fighting with this one for quite some time now.
I have my TreeitemRenderer as follows:

public class PermissionTreeRenderer implements TreeitemRenderer<PermissionTreeNode> {

    @Override
    public void render(final Treeitem treeItem, PermissionTreeNode node, int arg) throws Exception {
        final PermissionTreeNode ptn = (PermissionTreeNode)node;
        Treerow treeRow = new Treerow();

        treeItem.setOpen(ptn.isOpen());
        treeItem.appendChild(treeRow);
        PermissionItem current = (PermissionItem) ptn.getData();
        treeRow.appendChild(new Treecell(current.getName()));

    }
}

My BasicComposer (extending GenericForwardComposer) has both the attributes

private PermissionTreeModel treeModel;
private TreeitemRenderer treeitemRenderer = new PermissionTreeRenderer();

with getters and setters.

In my .zul my tree looks like this:

<tree id="permissionTree" width="100%"
    model="@{win$composer.treeModel}"
    treeitemRenderer="@{win$composer.treeitemRenderer}">
    <treecols>
        <treecol label="Item" width="400px" />
        <treecol label="Wert" />
    </treecols>
</tree>

What I’ve seen by testing so far is that he loads the model (he steps into the getter), but not the treeitemRenderer. the render-method isn’t called, no matter what I do.

Edit: My problem was that I only filled the root node (for testing) and it needs at least one child item to draw…

Well @dennis: I will try to use the new way like you said, so here’s my code:

<tree id="permissionTree" width="100%"
    model="@bind(vm.treeModel)" style="text-align:left;">
    <treecols>
        <treecol label="Item" width="400px" />
        <treecol label="Wert" />
        <treecol label="Einfügen" width="100px" />
    </treecols>
    <template name="model" var="node" status="s">
        <treeitem open="@bind(node.open)">
            <treerow>
                <treecell label="@bind(s.index)" />
                <treecell label="@bind(node.data)" />
                <treecell>
                    <hbox>
                        <button label="Index"
                            onClick="@command('showIndex', index=s.index)" />
                        <button label="Delete"
                            onClick="@command('delete', node=node)" />
                        <button label="Add After"
                            onClick="@command('addAfter', node=node)" />
                        <button label="Add Before"
                            onClick="@command('addBefore', node=node)" />
                    </hbox>
                </treecell>
            </treerow>
        </treeitem>
    </template>
</tree>

But it just won’t fill my tree with data anymore. Oh and, what’s that status s variable? Do I have to make preparations in any other file?

Edit: Problem solved, had to apply org.zkoss.bind.BindComposer

Thanks guys!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:30:22+00:00Added an answer on June 7, 2026 at 11:30 pm

    If you are using ZK 6, you could use new bind mechanism which is easier than it in ZK 5 and you don’t need to write a renderer. here is the code snippet shows the look https://github.com/zkoss/zk/blob/master/zktest/src/archive/bind/basic/collection-index-tree.zul

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.