get list item

Hi,

How can I get an item from list to string ?
I filled my list with XML. But now I need to get some item to process.

code:
dhx.ui({ id: ‘app’, view: ‘layout’, height: 482, width: 322,
rows: [
{ view: ‘layout’, type: ‘wide’,
rows: [
{ view: ‘toolbar’, type: ‘MainBar’,
elements: [
{ view: ‘label’, label: ‘Produtos’, id: ‘control_label_2’ }
], id: ‘toolbar_2’
},
{ view: ‘list’,
type: { width: 300, height: 22, margin: 0, padding: 10 },
id: ‘list_2’,
url: “…/…/getprodutosxml.aspx”,
datatype: “xml”,
template: “#codigo# (#nome#)”,
select: true
},
{ view: ‘button’, label: ‘Voltar’, id: ‘control_button_2’, click: “voltar()” }
], id: ‘layout_2’
}
]
});

$$(“list_2”).attachEvent(“onAfterSelect”, onitemclick);

function onitemclick() {
var id = $$(“list_2”).getSelected();
var myitem1 = ???

}

var id = $$(“list_2”).getSelected();
var myitem1 = $$(“list_2”).item(id);

Hi,

I already tried this. It return to me:

[object Object] as string.

I’m using a xml like your books.xml example with 2 fields: #name# (#lastname#)

please advise.

Just found the solution. Just use:

var id = $$(“list_2”).getSelected();
var name = $$(“list_2”).item(id).name;

thanks