on 09-28-2011 2:47 PM
Hi All,
I have Created A Tree UI Element and I need to Display or Use the index of the parent node of the current selected item(element). How To retrieve the value (index) of the Parent Node of the current selected element?
Use
int index = element.node().getParentElement().index();
where 'element' is your currently selected child NodeElement
Regards,
Robin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naga,
The following code will give you the parent node name:
IWDNodeElement parentElement = element.node().getParentElement();
String parentNodeName = parentElement.node().getNodeInfo().getName();
Displaying the parent's attributes can be done in the following way:
Iterator it = parentElement.node().getNodeInfo().iterateAttributes();
while (it.hasNext()) {
IWDAttributeInfo att = (IWDAttributeInfo)it.next();
String attName = att.getName();
Object attValue = parentElement.getAttributeValue(att.getName());
//do whatever is needed with these attributes
}
Hope this explains
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.