Dynamic Loading


Iam using professinal edition. I wanted to get the item text along with the item id in the server side(struts framework) whenever i click any node…

As of now… iam having a node with id “M1” and with item text “Model1”…

Iam using ajax call to load the url’s dynamically as,

String1 = “JobAction.do?param=loadTree”;

String2 = “JobAction.do?param=loadDoc”;

String3 = “JobAction.do?param=loadDate”;




var level = tree1.getLevel(id);




var url="";

if (level == 2) url=String2;

if (level == 3) url=String3;



Initially String1 XML is formed and the tree is loading,

but when i click the + sign to load next set of url’s,i get

level as 0

id as 0 and

text as 0…

When i changed the if condition as

if (level == 0) url=String2; Then i get

level as 0

id as 0,

text as 0 in the alert message of ajax js method

but i get some junk value associated with the id as, “%29M1%20” and text still as 0 in the server side code.

Please help like how to get the correct value of the ID and ItemText of which i click and want to load dynamically.

The last line in your code is incorrect ( probably a typo?)
must be

>>text as 0…
This is impossible situation, getItemText will return empty string in worst case, but it can’t return an 0 valueon its own.
The same code generates expected URL in case of local sample

If issue still occurs please provide an XML snippet for which error occurs