Web Dynpro, Tree
Hi all,
I implemented a recursive tree using the UI Element Tree. My customer wants to see this tree expanded up to the second level on the start of the view.
Is there a possibility to manage it (expand 2 levels of the tree) in my ABAP program or somehow else?
Kind regards,
Oleksandr
Hi,
Refer this online help: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/21/ad884118aa1709e10000000a155106/content.htm
Also refer this standard component: WDR_TEST_EVENTS. Look for the tree views.
I hope it helps.
Regards
Arjun
Similar Messages
-
Problems with tutorial: "Creating a Web Dynpro Tree"
Hi!
I'm a rookie and therefore I'm practicing on compleating some tutorials like "Creating a Web Dynpro Tree" (https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ec6622-8da5-2a10-349b-868b6a553efa)
I did just as the tutorial told me to (I think) but still I get a java.lang.NullPointerException when I deploy and run my application.
In the bold line is where it is something wrong:
public static void wdDoModifyView(IPrivateTreeView wdThis, IPrivateTreeView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
if (firstTime) {
IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNodeType");
/* parameter mapping from parameter "path" to
parameter "selectedElement"
treeNode._mappingOfOnAction()._addSourceMapping("path", "selectedElement");
/* parameter mapping from parameter "path" to
parameter "element".
treeNode._mappingOfOnLoadChildren()._addSourceMapping("path","element");
//@@end
What I don't understand is what the function/meaning of the parameter path is. The parameters selectedElement and element I do recognize and have written. And I don't understand why there is a difference between the two underscored line of code (see above) even though the comments claim that it does the same kind of mapping.
Best regards
/JohanI tried to get "addSourceMapping()." underscored so people would better understand what I was referring to but it didn't work and that's why it looked weired.
Thanks for your help Armin, now it works fine.
It was as you said.
if (firstTime) {
IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNodeType");
When I changed "TreeNodeType" to it's real ID, "TheNode" I didn't get a nullPointerException. I think it must be wrong in the tutorial because I followed the instructions which said to name it "TheNode" but then the author mus have forgot to change it from the default ID ("TreeNodeType").
Best Regards!
/Johan -
Hi there!
I am using the tree element in web dynpro.
Not the tree in the table.
I need to expand a part of the tree during loading
I do not find an example.
Any help is warmly appreciated.
Thanks in advance, FrankHi,
the "dynamic" tree expansion depends on who you populate the tree content e.g. how you load the data to your tree.
In my application, I have choosen to load the root nodes, first - all over sub-nodes (including items) are loaded "on demand" that means the user clicks on the node. This click will trigger the the action onLoadChildren which pulls the data from a data provider and binds the retrieved data to the corresponding
context node.
This expansion can be perfomed automatically by a recursive method which is called when a user pushes a button called "Expand all"....
I don't have much time to explain the details, but I will provided the source code..., hope it helps!
Darko
Source Code -
Import to the Method:
i_node_ref type IF_WD_CONTEXT_NODE = Reference to the context node
METHOD nav_tree_expand_all.
Data declaration
DATA node_elements TYPE wdr_context_element_set.
DATA node_element LIKE LINE OF node_elements.
DATA child_node TYPE REF TO if_wd_context_node.
DATA ls_tree_attr TYPE zlm_str_tree_gen.
DATA lt_tree TYPE zlm_tty_tree_gen.
Get all node elements
node_elements = i_node_ref->get_elements( ).
Loop over each element
LOOP AT node_elements INTO node_element.
" Get Static attributes
node_element->get_static_attributes( IMPORTING static_attributes = ls_tree_attr ).
" Check if data has already been loaded
IF ls_tree_attr-children_loaded = abap_true.
" now we know that the data has been loaded, only the elements have to be declared as expanded
ls_tree_attr-is_expanded = abap_true.
node_element->set_static_attributes( EXPORTING static_attributes = ls_tree_attr ).
" get possible other nodes recursively
child_node = node_element->get_child_node( 'SUBTREE' ).
me->nav_tree_expand_all( EXPORTING i_node_ref = child_node
i_screen_id = i_screen_id
i_component_id = i_component_id ).
ELSE.
" data has not been loaded yet...
" First load the nodes...
clear lt_tree.
me->get_nav_tree_nodes( .....importing lt_tree.). Custom specific data retrieval
IF lt_tree IS NOT INITIAL.
child_node = node_element->get_child_node( 'SUBTREE' ).
child_node->bind_table( lt_tree ).
" Update Attributes of the node
ls_tree_attr-is_expanded = abap_true.
ls_tree_attr-children_loaded = abap_true.
node_element->set_static_attributes( EXPORTING static_attributes = ls_tree_attr ).
" Call the method again recursively...
me->nav_tree_expand_all( EXPORTING i_node_ref = child_node
i_screen_id = i_screen_id
i_component_id = i_component_id ).
ENDIF.
" ... then load the items
CLEAR lt_tree.
me->get_nav_tree_items( .....importing lt_tree.). Custom specific data retrieval
IF lt_tree IS NOT INITIAL.
" Update Attributes of the node
ls_tree_attr-is_expanded = abap_true.
ls_tree_attr-children_loaded = abap_true.
node_element->set_static_attributes( EXPORTING static_attributes = ls_tree_attr ).
child_node = node_element->get_child_node( 'ITEM' ).
child_node->bind_table( lt_tree ).
ENDIF.
ENDIF.
ENDLOOP.
RETURN.
Edited by: Darko Mocelj on May 7, 2008 8:57 PM -
Web Dynpro Tree in the Component Controller
Hi!!!
I made a tree in the view. But to separating the view and the model I would like to create the tree in the component controller. Therefor I copy the code from the view to the controller and adapt them, but it doesn`t work. I get the first node and that`s it. I can`t add children, although I called the responsible method.
Some ideas????
Greets
RomanCheck your mapping between view & controller (actually, view controller & custom / interface / component controller) -- it seems that you have mapped only top-level node but not children.
VS -
Web Dynpro Tree with Hyperlink
Hello experts,
i´ve got a WebDynpro Abap application which conaints a tree - UI Element. This tree is filed with WD-Component names and by clicking a tree element the named WD-Component is loaded. Now i need a tree-node which sends the user to an external url, for example www.google.de
Does anybody know if this is possible?Hi Benjamin,
Here you can use the concept of exit plugs. Refer this online help: http://help.sap.com/saphelp_nw70/helpdata/EN/45/1bc575ba064574e10000000a114a6b/frameset.htm
I hope it helps.
Regards
Arjun -
I have just copied a standard Web Dynpro Abap, just changing the name for ZFITV_FPM_START.
I've noticed some things have not been copied. For example, the web dynpro applications.
So I've created a Web Dynpro Application for ZFITV_FPM_START, and called it ZFITE_EXPENSES, and copied the data in FITE_EXPENSES.
It doesn't appear in the Web Dynpro tree, even after saving it and activating the Web Dynpro. What can the problem be?
Thank you in advance.I had somehow created it in the original Web Dynpro. Thanks and sorry.
-
BW Hierarachies in Web Dynpro either using BI java SDK or Not
Hello,
I am working on a requirement to develop a web dynpro Tree for a BW Hierarchy. On This requirement I have following Questions.
1. How can I retrieve Nodes/Hierarchies from BW Hierarchy into the query? Is it Query , Cube or RFC?.
2. What is the standard way to retrieve the Hierarchy onto Web Dynpro?.
I appreciate if somebody can help on this problem.
Thanks,
Raj Peddisetty.Raj,
we used the following delivered function modules to read, add and delete the nodes:
--ZRSBB_NODES_READ_WITH_FILTER
--BX_FAVOS_ADD_OTHERS
--BX_FAVOS_DELETE_NODE
We created some wrapper function modules to call these above delivered fm's.
Hope this helps.
--MLS -
Hi!
I can´t insert any fields on the right side of a tree item.
I have to do like a docking in SAP with a dynpro on the right side and move dinamically the right side if someone click on the tree.
Can anyone help me?
TranksSorry in Web dynpro Java!
And if it´s not possible. How can I Communicate two Iviews?
how can I pass parameters from an Iview to another?
Thanks! -
Recursive Tree using Web Dynpro java
Hi
I've been trying to create a recursive tree using java in Web Dynpro.
Can you please suggest a good example to try with?Hi,
Check the below links....
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/integration%20of%20a%20tree%20structure%20in%20a%20web%20dynpro%20table.pdf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf
http://help.sap.com/saphelp_nw70/helpdata/en/13/4cde139306304480e89d815ffcf891/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/af/44ea406c9d3d43e10000000a155106/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/21/ad884118aa1709e10000000a155106/frameset.htm
Code Example,
http://help.sap.com/saphelp_nw70/helpdata/en/16/1ec1814e566f4baf943c53ccf48552/frameset.htm
null -
Integration of a Tree Structure in a Web Dynpro Table
Hi,
I am implementing an Integration of a Tree Structure in a Web Dynpro Table.
The Tree-Table os working as required, but I can not work with the OnLeadSelect Action of the table.
The Action does not work as required, meanning, it returns all the time the first row and not the "lead select".
As far as I read I should add some code to the wdDoModifyView method, but I did not figure out exactly what...
Thanks in advance,
Aviadcheck this URL:
/people/valery.silaev/blog/2005/06/20/master-of-columns-part-ii -
Formatting tree UI element in web dynpro
Hi,
I am new to web dynpro java.
I want to format tree in web dynpro java.I mean i want to add spaces between the nodes of a tree or can i get something like hgutter functionality between the nodes.
Regards,
ujjwal kumarHi
No
Only thing u can do is set Is Design to Emphasized (Bold) and add any images into Node and item both.
depends on image size u will get some space between text of tree.
(Applicable with CE 7.1 onwards not in 7.0)
Tree [help|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/de59f7c2-0401-0010-f08d-8659cef543ce]
Best Regards
Satish Kumar
Edited by: satish jhariya on Mar 18, 2009 4:49 PM -
Hello All,
I want to create a web dynpro application that implements some functionlity that I saw in the SAP backend system. In the backend, I have a transaction that allows me to drill down into nodes and add and remove them with a right click context menu. This is like a tree structure with the ability to add, remove and modify node elements. I want to present this to the front end user using web dynpro and possible in a nice table format. How can I go about doing this? Any suggestions?
Thanks
Marshall.Ok, I try to explain with a simple example.
Say, your context has the following structure:
WebDynproClass (node, cardinality=0:n)
- expanded (boolean)
- name (string)
- SubClasses (recursive node -> Class)
Then, you can build the following tree:
UIElement (root)
+ AbstractCaption (e_1)
+ AbstractButton (e_1_1)
+ Button (e_1_1_1)
+ RadioButton (e_2)
with code like
/* helper method, put inside //@@begin others...//@@end section */
private IWebDynproClassElement addSubClass(String name, IWebDynproClassElement parent)
IWebDynproClassElement child = (parent == null)
? wdContext.nodeWebDynproClass().createAndAddWebDynproClassElement()
: parent.nodeSubClasses().createAndAddWebDynproClassElement();
child.setExpanded(true);
child.setName(name);
return child;
/* builds initial tree, call from wdDoInit() */
private void init()
IWebDynproClassElement root = addSubClass("UIElement", null);
IWebDynproClassElement e_1 = addSubClass("AbstractCaption", root);
IWebDynproClassElement e_1_1 = addSubClass("AbstractButton", e_1);
IWebDynproClassElement e_1_1_1 = addSubClass("Button", e_1_1);
IWebDynproClassElement e_2 = addSubClass("RadioButton", root);
Now if you want to add "Caption" as subclass of "AbstractCaption" later, you have to find the context element that represents the "AbstractCaption" class and add it as above:
IWebDynproClassElement parent = find("AbstractCaption");
addSubClass("Caption", parent);
If you have to implement the find() method at all depends on your application. Maybe you want to
- provide a context menu (available since 7.1) on the tree nodes to add child nodes, or
- provide a static menu at the table cell editor (since 7.0)
- you provide a toolbar button to add a child node to the currently selected tree node (since 6.40)
Example for a static menu at a TextView cell editor:
Table (dataSource = WebDynproClass)
+ TreeByNestingTableColumn (expanded = WebDynproClass.expanded)
+ TextView (text = WebDynproClass.name)
+ Menu
+ MenuItem (id = AddChildItem, onAction = AddChild, nodeElement -> AddChild.parent)
Action "AddChild" has text "Add Child" and a parameter "parent" of type IWebDynproClassElement. Action handler is
public void onActionAddChild(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.demo.rec.treetable.comp.wdp.IPrivateMainView.IWebDynproClassElement parent )
//@@begin onActionAddChild(ServerEvent)
addSubClass("Child #" + parent.nodeSubClasses().size() + " of " + parent.getName(), parent);
//@@end
Then you will get a menu at each tree node with an entry "Add Child" that adds a new child node with some generic text.
Armin -
Problem of refreshing a tree in web dynpro java
hi all,
I'm facing a problem for refreshing a tree in web dynpro java for SAP HR.
I created a viewset with 2 cells( 1 view for each).
In the 1st view I created a droplistbyindex to select the unit ID and in the 2nd view ( defaut=false) I called a method to populate my tree according to my selection in the 1st view ( method called in wdInit).
When I make the first selection everything is ok.
But when I select another unit ID, the tree is not changed and I know the context is well changed according to my selection.
So I think the method is executed only the first the view is called.
In this case, how can I refresh my tree on real-time?
Thanks for your help
YiminMay be u can write the code wdDoModify instead.
-Ashutosh -
hi,
I developed a web dynpro on the base of the WDT_TREE structure.
Itu2019s important to underline that each node can contain different type of sons: ITEM and NODE as you can see in the structure below
For example:
ROOT
NODE1
Item 1 -> Nodeu2019s 1 son
Item 2 -> Nodeu2019s 1 son
Item 3 -> Nodeu2019s 1 son
Item 4 -> Nodeu2019s 1 son
Node2 -> Nodeu2019s 1 son
Node3. -> Nodeu2019s 1 son
What I need to do is to modify the sonsu2019 order on the base of a key defined in a specific program (see the example below).
Example:
ROOT
NODE1
Item 1 -> Nodeu2019s 1 son
Node2 -> Nodeu2019s 1 son
Item 2 -> Nodeu2019s 1 son
Node3 -> Nodeu2019s 1 son
Item 3 -> Nodeu2019s 1 son
Item 4 -> Nodeu2019s 1 son
Thanks Laura.hi Gunjan ,
refer this article "ALV and Standard Table as Hierarchy in Web Dynpro ABAP" :
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f&overridelayout=true
also check the standard WD component salv_wd_demo_table_tree
also keep these steps in mind , quoted in SDN thread :
Following 2 things are the most important steps
"A) identify the table as hierarchy table:
wd_this->go_table->if_salv_wd_table_settings~set_display_type( if_salv_wd_c_table_settings=>display_type_hierarchy).
(wd_this->go_table is the reference to wd alv object:)
"B) mark the columns you want to have as nodes with following statement:
ls_col-r_column->if_salv_wd_column_hierarchy~set_hierarchy_column( value = abap_true ).
(ls_col is reference to the column)
regards,
amit -
Tree Structure in a CE Web Dynpro Table
Hi,
Anyone has any idea how to do it in the CE Edition?
I've tried to follow the steps of the older versions and it didn't work:
http://help.sap.com/erp2005_ehp_03/helpdata/EN/bc/601c420d84db2ce10000000a1550b0/frameset.htm
Thanks and regards,
EduardoHi Armin,
The tutorial asks me to: "Insert a Web Dynpro table, including the UI element TreeByNestingTableColumn (also known as the master column) in the layout of the TreeTableView."
I didn't find this TreeByNestingTableColumn, do you have any idea what i'm doing wrong?
Thanks and Regards,
Eduardo
Maybe you are looking for
-
How to import many large graphic images to fit into column width?
I have a 2-column layout and about 150 large graphic images which must be imported so that they fit exactly into the column width. These are bitmaps which have all the same dimensions. All of them will need a border (stroke). And they should be inlin
-
Why can I not rent a transformers movie
Why can I not rent a transformers movie
-
Verity - files and db query combo
Is it possible to have both a search of some files and a query of a database table in the same cfcollection? If so, guidance on how to do this?
-
MacBookPro speaker doesn't work
My speaker icon is grey and I'm not able to ear sound when OS Maveriks has been started. I'm able to hear the bell at the Mac startup. I'm able to ear sound when I use the earphones but not with speaker. There is also a RED light visible on jack conn
-
Why it is throwing null at last whenever i am running this program
public static void main(String args[]) String str; try FileReader fis = new FileReader(C:\\src\\vinaysingh\\xmlreq.xml"); BufferedReader br= new BufferedReader(fis); do