how can I pass popup's value to bind control?

hi, guys.
Currently, I create a textarea and a popup.
Then , I bind popup to the textarea. when I click popup’s item, I hope to get this item’s value and pass back to the textarea. but I do not know how to get the popup’s item’s value.

Thanks in advanced.
The following is my code.
when I click popup, they even do not execute alert(“hello”);

[code]

<script src="../common/viewsources.js" type="text/javascript"></script>
<link rel="STYLESHEET" type="text/css" href="../common/viewsources.css">
	<script type="text/javascript" charset="utf-8">
		dhx.ui({
			rows:[{
				view:"toolbar", type:"MainBar", elements:[{view:"textarea", inputHeight:'100',label: 'Menu', popup:"Menu1", inputWidth:200, align:"left"}]
			}]
		});

		dhx.ui({
			view:"popup",
			id:"Menu1",
			body:{
				view:"list",					 
				//url:"menu.xml", 
				data:[
			{id:"grid_1",name:'shuzhan',email:"shuzhan1983@gmail.com"},
			{id:"grid_2",name:'s',email:"s.com"},
			{id:"grid_3",name:'h',email:"h.com"},
			
			],
				
				datatype:"json",
				template:"#name#",
				select:true, 
				y_count:3
			}
		}).hide();		
			$$("list").attachEvent("onafterselect",function(){
		 alert("hello");
		});
		$$("list").attachEvent("onitemclick",function(){
		 alert("hello");
		});
	</script>
</body>
[/code]

change $$(“list”).attachEvent(“onafterselect”,function(){
alert(“hello”);
});
$$(“list”).attachEvent(“onitemclick”,function(){
alert(“hello”);
to
$$(“Menu1”).attachEvent(“onafterselect”,function(){
alert(“hello”);
});
$$(“Menu1”).attachEvent(“onitemclick”,function(){
alert(“hello”);

still doesn’t work.

Hi,

The following event setting could be correct if “list” were the id of List.
$$(“list”).attachEvent(“onitemclick”,function(){
alert(“hello”);
})

In your example, list and textarea do not have any ids. Therefore, you should:

  1. set an id for the List view:

dhx.ui({
view:“popup”,
id:“Menu1”,
body:{
view:“list”,
id:“mylist”,

}
}).hide();

  1. set an id for textarea - you need to it to set textarea value:
    …{view:“textarea”,id:“txta”,…}…

  2. set event:

$$(“mylist”).attachEvent(“onitemclick”,function(id){
var name = this.item(id).name;
$$(“txta”).setValue(name);
$$(“Menu1”).hide()
});

No. In fact, after I add the id property, the whole page do not work anymore.
So, I delete id property.
It is so strange why I can not add id property for my list object?

It works…
thanks