Executing javascript that comes inside an AJAX response

Executing javascript that comes inside an AJAX response

  
Hi guys,

I'm using Outsystems 4.2.* version and I'm trying to do the following:

I have a basic screen with a textbox, a button and a Webblock with the TreeWidget Component.

The textbox gets a Data field inputed by a user.
The button calls an Ajax action that builds a TreeRow List for the TreeWidget Component.
At the end of that action I refresh the Webblock with the Ajax tool, but the TreeWidget does not get refreshed. I see that the Webblock is refreshed but the tree itself doesn't, and I get a blank "Webblock".

I've searched in some Forums and all the solutions I found was something like this:

"bla bla bla bla
As far as I know changing the content of a div to a javascript block won't cause that javascript code to execute

function loadHtml(obj) {
if(obj.className == "menuItem")
{
$.ajax({
type:"GET",
url:"content/" + obj.id + ".html",
dataType: "html",
success:
function(data, status)
{
contentDiv.innerHTML = data;
}
});
}
}

bla bla bla bla.....
I think you need to change:

contentDiv.innerHTML = data;

to

eval(data); "

So, my question is what can I do to get my tree (from the TreeWidget) refreshed with ajax?

Does anybody have an idea?

Thanks in advance.