0

Is there a way to use new data binding in tree?

asked 2011-03-20 03:42:28 +0800

distelka gravatar image distelka
68 1

Hi All,
I`m interesting is there a way to used in a tree something like this:

<tree use="${customTree}"  selectedItem="@{selected}">
...
</tree>
<grid>
	<columns>
	...				
	</columns>
	<rows>
	<row>
	     <label value="@{selected.name}" />
	</row>					
</grid>

I saw this for listbox : http://books.zkoss.org/wiki/ZK_Essentials/Displaying_Information_in_a_Grid_Using_Data_Binding/Implementing_Data_Binding

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2011-03-20 20:34:41 +0800

samchuang gravatar image samchuang
4084 4

Hi

I think it's the same, you can use data-binding in any component, doesn't limit to grid

link publish delete flag offensive edit

answered 2011-03-21 04:44:52 +0800

distelka gravatar image distelka
68 1

Hi samchuang,
I tried it but without success.Could you provide me a quick example
Thanks in advance

link publish delete flag offensive edit

answered 2011-03-21 16:57:45 +0800

distelka gravatar image distelka
68 1

updated 2011-03-21 16:58:54 +0800

<zk>			                                 
	<zscript>					
	import org.zkoss.zksandbox.tree.BinaryTreeModel;
	
	BinaryTreeModel btm = new BinaryTreeModel(new ArrayList(new org.zkoss.zksandbox.BigList(1000)));
         
         
	</zscript>
	<tree id="tree" model="${btm}" selectedItem="@{selected}"/>
           <grid>
		<columns>
		   <column width="65%" />
		</columns>
		<rows>
		  <row>
			<label value="@{selected}" />
		  </row>					
		 </rows>
	    </grid>
</zk>
			

Something like this not working :( Any help ?

link publish delete flag offensive edit

answered 2011-03-21 19:47:20 +0800

samchuang gravatar image samchuang
4084 4

updated 2011-03-21 19:47:54 +0800

You need a AnnotateDataBinderInit in page or create a AnnotateDataBinder by yourself

Activate the Annotated Data Binding Manager

link publish delete flag offensive edit

answered 2011-03-22 02:43:26 +0800

distelka gravatar image distelka
68 1

updated 2011-03-22 02:43:37 +0800

Yes, I have it.I forgot to paste it .
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>

link publish delete flag offensive edit

answered 2011-03-22 03:16:19 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Could it be

<tree id="tree" model="${btm}" selectedItem="@{selected}"/>

should be instead (look at @)
<tree id="tree" model="@{btm}" selectedItem="@{selected}"/>

?

link publish delete flag offensive edit

answered 2011-03-22 07:13:47 +0800

distelka gravatar image distelka
68 1

So any idea for my problem ? From someone :)Please ....

link publish delete flag offensive edit

answered 2011-03-22 20:08:17 +0800

samchuang gravatar image samchuang
4084 4

updated 2011-03-22 20:10:02 +0800

Hi

could you post a runnable sample code, it can help others to debug ?

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: 2011-03-20 03:42:28 +0800

Seen: 499 times

Last updated: Mar 22 '11

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