0

by Tree node click refresh data

asked 2012-02-17 07:13:10 +0800

sam111 gravatar image sam111
9

Hi ;
may be, can some body help.
I have a tree, when click on A tree node, in Spring Backing Bean i set the selectedNode through an onClick event.
The data in the center layout is in Tabbox and it will not be refreshed.

when creating the Tree,selectedNode is null and the textbox is clear in tabbox, after Click on a Tree Node selectedNode is not null.
aber getSselectedNode in schemaTreeComposer will not be more asked to refresh data and Textboxt still clear.

How can I refresh data in Tabbox after click on a Tree Node?

hier is apiece of my code
schemaTreeComposer is in ApplicationContext.xml as Spring Backing Bean

ApplicationContext.xml:

<bean id="schemaTreeComposer" class="de.volkswagen.mbproduct.web.backing.tree.dynamic_tree.SchemaTreeComposer" scope="desktop"/>

myZul file


<window id="propertyWindow" apply="${schemaTreeComposer}">
<style>
.hightlight {
color: #1469AB;
font-weight: bold;
}
.leftAlign {
margin-left: 20px;
margin-right: auto;
}
</style>

<grid fixedLayout="true" id="propertyView" visible="@{schemaTreeComposer.currentNode != null}">
    <rows>
       <row sclass="leftAlign" height="30px">
            <label style="text-align: left" value="Name" width="70px" sclass="leftAlign"/>
            <hlayout style="text-align: left">
                <textbox id="name" value="${schemaTreeComposer.selectedNode.name}" width="150px" tabbable="true" />
            </hlayout>
      </row>
  </rows>
</grid>
</window>

thanks

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-02-23 06:29:30 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

${...} is evaluated ONCE only when the page is loaded. If you would like the value in textbox to be updated automatically, I would suggest using MVVM in ZK6.

http://books.zkoss.org/wiki/Small_Talks/2011/November/MVVM_in_ZK_6_-_Design_CRUD_page_by_MVVM_pattern

Though this example is not talking about a tree but the idea is similar. User select from a listbox the current item and show on the textbox the details of that item.

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2012-02-17 07:13:10 +0800

Seen: 353 times

Last updated: Feb 23 '12

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