on 03-06-2008 8:10 AM
hai all,
Iam using tree UI element.
I need to get the currently selected element in the tree.Iam able to get the value in leadselect of table but i need it on the click of the element in tree.
plz help me in this issue.Any help will be greatly appreciated.
Thanks in advance
Sharanya.R
you can use node->get_lead_selection( ) which returns you element and using get_static_attributes( ) method you can get the values of that element.
If you want ot get the value when you press some link, have an action handler for that link and in the action handler method you can get the current element using wdevent's get_context_element method ( wdevent->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ) which returns element. From element you can get values using get_static_attributes or get_attribute methods.).
regards
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai nikhil,
In the onloadchildren action of master column i call a method.
when the user clicks on the parent element of tree i need to get the selected element as that shud be given as input and the subelements shud be obtained.In lead select of table i have already obtained the values .all i need is to get the selected value when user clicks on the arrow next to the parent element in tree.
plz nikhil provide me some solution na.
Thanks n regards
Sharanya.R
IWDNode.getTreeSelection()
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use
try {
IWDNodeElement nodeElement = wdContext.nodeOrders().getTreeSelection();
// Change the line to your own attribute and data type (instead of object)
Object value = nodeElement.getAttributeValue("<Your Attribute Name>");
wdComponentAPI.getMessageManager().reportSuccess(value.toString());
} catch (WDContextException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Regards
Ayyapparaj
hai ayyaparaj,
i gave the following code in wdmodify method and in the try2 method i tried printing the value.but its not getting printed when i select a value in tree.
try
{
IWDNodeElement nodeElement = wdContext.nodeCatalogEntries().getTreeSelection();
// Change the line to your own attribute and data type (instead of object)
String value = nodeElement.getAttributeAsText(wdContext.nodeCatalogEntries().currentCatalogEntriesElement().getTitle());
wdThis.try2(value);
}
catch(Exception e)
{
e.printStackTrace();
}
Thanks n Regards
Sharanya.R
First, don't add this code inside wdDoModifyView() but to the select action handler.
Second, change it into
try
{
ICatalogEntriesElement selection = (ICatalogEntriesElement) wdContext.nodeCatalogEntries().getTreeSelection();
String title = selection.getTitle();
wdComponentAPI.getMessageManager().reportSuccess("Selected entry: " + title);
}
catch(Exception e)
{
// should not happen
}
Armin
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.