on 09-28-2015 4:53 PM
Hello everybody!
We're currently trying to implement a generic export from WebDynpro tables to Excel files using a faceless WebDynpro DC as described here. The main functionality works fine, but I have to explicitly define the context node (IWDNode instance) I want to export data from. To make the functionality more convenient, I'm trying to get the context node directly from the table's dataSource mapping. I can get the path to the node using
IWDTable table = (IWDTable)view.getElement(tableName);
String dataSourceNodeName = table.bindingOfDataSource();
but I cannot see a way to get the actual node (IWDNode instance) that I'll have to pass to the exporter, regardless of elements being present or not inside that node.
wdContext.currentContextElement().node(dataSourceNodeName);
does not work as expected (it returns null), and
wdContext.getChildNode(dataSourceNodeName, IWDNode.LEAD_SELECTION);
returns null, too. Do you know of any working way to retrieve the actual node from it's path or name or, even better, from the IWDTable element itself?
Thanks
Michael
once you get the node, can't u use the generic api to get all the attributes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My table view element's dataSource is bound to a data node "MySuperNode.TableDataSourceNode" with Collection Cardinality 0..n like this:
Inside wdDoModifyView, I'm retrieving the relevant table element using
String myTableName = "someViewElementName";
IWDTable table = (IWDTable)view.getElement(myTableName);
Then I get the table's dataSource using
String dataSourcePath = table.bindingOfDataSource();
This returns the path to the context node bound as dataSource below the main context node, in the above case it's "MySuperNode.TableDataSourceNode". It would be great to be able to retrieve the actual node instead of it's path, but I do not find any method that might be appropriate for this. So I try to get the actual node from this path:
IWDNode dataNode = wdContext.currentContextElement().node(dataSourcePath);
This returns null. Another approach was
IWDNode dataNode = wdContext.getChildNode(dataSourcePath, IWDNode.LEAD_SELECTION);
or
IWDNode dataNode = wdThis.wdGetMyViewController().wdGetAPI().getContext().getRootNode().getChildNode(dataSourcePath, IWDNode.LEAD_SELECTION);
but I do not get anything but null. Maybe I'll have to add something to or remove something from the path ?
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.