cancel
Showing results for 
Search instead for 
Did you mean: 

iBrowser - Check for Child node

Former Member
0 Kudos

Hi,

I have a iBrowser Tree running on my IRPT page which is a multi-level tree structure.

On click of a node, i need to check whether is there any child node available for the selected node or not.

Is there any method to check that.

Regards

Muzammil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Probably there is or probably there isin't , I am not too sure but if you look at an iBrowser tree the expansion or + sign would be visible only if there are child nodes , correct?

So what is your requirement that you need to check for child nodes?

Thanks

Udayan

agentry_src
Active Contributor
0 Kudos

Underlying the iBrowser tree is an xml document. There are several xPath expressions which could work (count, boolean, probably several other ways) to return the information you request.

But I guess the real question is what is the business reason for needing this information. Do you need it built into the underlying xml structure?

Regards,

Mike

Former Member
0 Kudos

Udayan/Mike,

The requirement is to add, update, delete records from/to the existing Tree.

I should only delete a node, if it is a child node. I cannot delete a parent node.

So before deleting, i need to check whether the selected node contains siblings or not.

Regards

Muzammil

Edited by: Muzammil Ahamed on Feb 18, 2011 6:38 PM

Answers (1)

Answers (1)

jcgood25
Active Contributor
0 Kudos

Assuming you're either using the SelectionEvent or a button, the results of

document.iBrowser.getBrowserObject().getSelectedPath();

will give you the full path of the selected node in the tree.

Simply use javascript and indxOf (http://www.w3schools.com/jsref/jsref_IndexOf.asp) to know if a forward slash (/) exists - one or more would indicate the level in the tree, and no slashes would mean root folder.

Former Member
0 Kudos

Jeremy,

Yes, i am calling this method on SelectionEvent.

I tried using getSelectedPath(). But it will only fetch till the record which i selected. There is no Forward Slash (/) after the name of the node. For example, Parent1/Sibling1/Sibling2. But i have a sibling3 which is a child node for sibling2. I am not able to track that.

I also tried getFolderClosedImage(). It is not returning any value. I think we need to load new image in iBrowser Applet.

Regards

Muzammil

Former Member
0 Kudos

Hi Muzammil,

Why do not use a field in your query template to indicate the existence or not child node?

I think that this information could come in the source query template and you access this hidden field in your iBrowser to get the value.

Former Member
0 Kudos

Marcelo,

Can you please explain it a bit more. I am fetching data from database and already have a datalink value which is also very important.

Regards

Muzammil