on 05-07-2009 12:12 PM
Hello,
I am trying to build an application which shows an tree and an table UI which shows additional information to the selected tree node. (like Windows Explorer)
I am using an context like this:
Class - - - - - - - - -- (Mapped value Node)
- SubClass - - - - - (Recursion Node)
- id - - - - - - - - -- - -(Value attribute)
- name - - - - - - - - -(Value attribute)
.
.
For the tree I am unsing this event handler
public void onActionClassNodeSelected(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, de.aequitas.sap.wd.java.easyclass.wdp.IPrivateEasyClassView.IClassElement element )
wdModifyView contains this:
public static void wdDoModifyView(IPrivateEasyClassView wdThis, IPrivateEasyClassView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
IWDTable pictureTable = (IWDTable) view.getElement("PictureTable");
if(firstTime)
{
IWDTreeNodeType node = (IWDTreeNodeType) view.getElement("TreeNodeType");
node.mappingOfOnLoadChildren().addSourceMapping("path", "element");
node.mappingOfOnAction().addSourceMapping("path", "element");
}
I think I could use now
pictureTable.bindDataSource()
, but do not know where to get the needed parameter.
Thank You
Bernd
Hi,
with the code
//Your existing code
IWDTable pictureTable = (IWDTable) view.getElement("PictureTable");
//use the following code for binding
IWDNodeInfo nodeInfo = wdContext.nodeClass().getNodeInfo();// Assuming class Node is bound to table.
pictureTable.bindDataSource(nodeInfo);
I have the problem that the table is showing permanent the nodes of the first level. If I select an element in the tree, the table should show the content of this element (second level), but it is still showing the top level information.
Thank you
Bernd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are the detail data all available in the node to which the tree is bound? In the Windows Explorer it's more like a separate node for the files of the currently selected folder.
Providing the details for the currently selected class could be implemented like this:
Context
+ Class
+ SubClass
- id
- name
+ Details (supply function=supplyDetails)
- attribute1
- attribute2
In the selection handler, just call
wdContext.nodeDetails().invalidate();
which triggers the supply function. Implements the supply function such that it fills the "Details" node with the details for the currently selected tree node (=tree selection of node "Class"):
void supplyDetails(...)
{
IClassElement selectedClass = (IClassElement) wdContext.nodeClass().getTreeSelection();
/* fill node with details for selected class... */
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> Hello,
>
> I am trying to build an application which shows an tree and an table UI which shows additional information to the selected tree node. (like Windows Explorer)
>
> I am using an context like this:
> Class - - - - - - - - -- (Mapped value Node)
> - SubClass - - - - - (Recursion Node)
> - id - - - - - - - - -- - -(Value attribute)
> - name - - - - - - - - -(Value attribute)
> .
> .
>
> For the tree I am unsing this event handler
>
public void onActionClassNodeSelected(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, de.aequitas.sap.wd.java.easyclass.wdp.IPrivateEasyClassView.IClassElement element )
>
> wdModifyView contains this:
>
>
public static void wdDoModifyView(IPrivateEasyClassView wdThis, IPrivateEasyClassView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime) > { > //@@begin wdDoModifyView > IWDTable pictureTable = (IWDTable) view.getElement("PictureTable"); > if(firstTime) > { > IWDTreeNodeType node = (IWDTreeNodeType) view.getElement("TreeNodeType"); > node.mappingOfOnLoadChildren().addSourceMapping("path", "element"); > node.mappingOfOnAction().addSourceMapping("path", "element"); > }
>
> I think I could use now
pictureTable.bindDataSource()
, but do not know where to get the needed parameter.
>
> Thank You
> Bernd
Hi,
Following is the code to do this
//Your existing code
IWDTable pictureTable = (IWDTable) view.getElement("PictureTable");
//use the following code for binding
IWDNodeInfo nodeInfo = wdContext.nodeClass().getNodeInfo();// Assuming class Node is bound to table.
pictureTable.bindDataSource(nodeInfo);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.