Node in a recursive Node
Hi Colleagues.
I want to populate a hierarchy using the UIElement Tree. I have a created a node in the following manner.
MasterNode
|____recrusiveNode - Pointing to MasterNode
|____valueNode - SubNode under MasterNode
| |___value1
|___name
I can able to populate the MasterNode which has a recursiveNode with attribute name. It works fine.
But when I'm not able to populate the ValueNode for recursiveNode element. It throws a context exception.
Can anyone advise how to populate it?
Thanks
Bala
Edited by: Balachandar P on Dec 30, 2009 9:25 AM
Edited by: Balachandar P on Dec 30, 2009 9:25 AM
Edited by: Balachandar P on Dec 30, 2009 9:26 AM
IMasterNodeElement parent = wdContext.nodeMasterNode().createAndAddMasterNodeElement();
parent.setName("Parent");
IValueNodeElement e = parent.createAndAddValueNodeElement();
e.setValue1("Parent Value1");
IMasterNodeElement child= parent.nodeRecursiveNode().createAndAddMasterNodeElement();
child.setName("Child");
IValueNodeElement e = child.createAndAddValueNodeElement();
e.setValue1("Child Value1");
Armin
Similar Messages
-
Recursively Finding a Node in a Linked List
I'm trying to find a node recursively in this linked list but keep coming up with an error message - can anyone tell me what is wrong?
public boolean find (Object obj)
DonorNode node = new DonorNode(obj);
DonorNode current = list;
if (don.equals(current))
return true;
else
return find(current.next);
}Please post within code tags (button above the message box).
Without more information it's hard to say.
What is list?
What is don?
If you don't mind me pointing out:
A method named find conventionally returns some object it is searching for or null if not found.
What you have (by that I mean a method returning boolean) is generally named contains (or some other obvious predicate name).
That being said, if I assume that DonorNodes contain some Object and have getter functions to access those; and that list is a DonorNode representing the head of the list, try something like:public boolean contains(Object o) {
return contains(o, list);
private boolean contains(Object o, DonorNode n) {
if (n.getObject() == o)
return true;
if (n.getNext() == null)
return false;
return contains(o, n.getNext());
}Although keep in mind that comparing two Objects using '==' will result in reference only comparison. If you need some other form of comparison you might consider using the equals method (make sure you then implement it in all potentially contained classes) or even narrowing the accepted argument to classes that implement the Comparable interface.
Hope this helps. -
Scene Graph traversal. Getting all the children of a node recursively
Hi,
Requirement: To resize all the controls of a scene (including controls that contain text like label, button) as per the scene size
Approach: To implement the above requirement (see code snippet below), I added Listeners for width and height properties of a Scene and whenever the scene size changes, I get all the children of the root node of the scene and invoked the setScaleX() and setScaleY() for the children.
Problem: In my design, labels and buttons are wrapped inside VBox, HBox etc. Method getChildrenUnmodifiable() returns only the first level of children and hence my HBox and VBox are getting scaled as per the scene size but not the children of VBox and HBox. Is there a built-in function to get all the children of a node recursively ? Or what is the best way to resize text as the scene size changes ?
Scene mainScene = new Scene(borderPane, PERMANENT_WIDTH,
PERMANENT_HEIGHT, Color.HONEYDEW);
rootNode = mainScene.getRoot();
mainScene.widthProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, Object oldValue,
Object newValue) {
Double widthScalingFactor = ((Double) newValue) / PERMANENT_WIDTH;
ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
for (Node child : children) {
child.setScaleX(widthScalingFactor);
mainScene.heightProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, Object oldValue,
Object newValue) {
Double heightScalingFactor = ((Double) newValue) / PERMANENT_HEIGHT;
ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
for (Node child : children) {
child.setScaleY(heightScalingFactor);
});Thanks.Added the following code to get all the children recursively. now the scaling is applied to all nodes of a scene.
private static void getChildren(Parent parentNode) {
if (parentNode.getChildrenUnmodifiable().size() != 0) {
ObservableList<Node> tempChildren = parentNode
.getChildrenUnmodifiable();
allChildren.addAll(tempChildren);
for (Node n : tempChildren)
getChildren((Parent) n);
} else
allChildren.add(parentNode);
} -
[Tree] item and node order ! (Recursive Node)
I made a wd4a has organizatonal structure tree. but I have some problem with the org tree.
I want to have a tree(org structure) in item(person) and node(organization) order.
Root Root
|- Person 1 |- Head Dept
|- Person 2 | |-Person 3
|-Head Dept -> | |-Person 4
| |- Person 3 |-Sales
| |- Person 4 |- Person 1
|-Sales |- Person 2
( to be displayed) (current displayed)
Whiat's the problem?
Although the both of them have a same contents, I really want to display in person and org order .
Plz. help.I solved this problem myself and it makes me very so tired.
I guess that Recursive node tree have some bugs.
If a node have one recursive node and one sub-node and some kinds of attributes,
we have to make a decision on how to display and sort them(sub-node and attributes)
There is a example below as I really want to sort them.
C_Drive Folder
- file 1
- file 2
- Folder 1
- file3
- Folder 1-1
- Folder 2
Context
|-Folder Node
| |-File Node
| | |-File Name attribute
| |-Folder Name attribute
| |-Folder_Content -> Recursive Node
When you meet this situation,you must implement the context nodes and
the names of context node and recursive node must be in alphabet order you want to display.
I am sorry for my crumsy writting English. -
How to manipulate recursive node with context api?
Hi, all.
I made a recursive node in my context. So it is like a tree.
When I choosed one child node in my tree, how can I get it`s current element?
Thanks a lot.Hi Louis
Check this PDF link
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf
Also check this elearning link.It gives info of supply function
https://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/60086bd5-9301-2b10-6f97-a14366a5602b&overridelayout=true
Regards
Ruturaj -
Dynamic context in web dynpro abap: recursion node is possible?
Hi,
i'm working with web dynpro ABAP and I need to create a dynamic recursion node. Is possible?
thank you.
Regards.
AlHello Saravanan,
this is my code that creates a context node with recursion node, but supply_method i never called. why? could you help me?
CALL METHOD lr_root_info->add_new_child_node
EXPORTING
name = y_name
is_mandatory = abap_false
is_multiple = abap_true
is_mandatory_selection = abap_false
is_multiple_selection = abap_true
is_singleton = abap_true
is_initialize_lead_selection = abap_true
is_static = abap_true
supply_method = 'SUPPLY_NAV_LIST'
RECEIVING
child_node_info = lr_node_info.
ls_attribute-name = 'TEXT'.
ls_attribute-type_name = 'STRING'.
CALL METHOD lr_node_info->add_attribute
EXPORTING
attribute_info = ls_attribute.
ls_attribute-name = 'ENABLED'.
ls_attribute-type_name = 'WDY_BOOLEAN'.
CALL METHOD lr_node_info->add_attribute
EXPORTING
attribute_info = ls_attribute.
lr_node_info->add_recursive_child_node( child_name = y_name_nav child_info = lr_node_info is_static = abap_false ).
Thank you.
Al -
How to get current node element for recursive node.
Hello Xperts,
I have a requirement where I need to find the current node element of the recursive node.
I was trying following code for the same
Data:
selected_elem type ref to if_wd_context_element.
selected_elem = WDEVENT->GET_CONTEXT_ELEMENT( NAME = 'CONTEXT_ELEMENT' ).
selected_elem ->get_static_attributes(
IMPORTING
static_attributes = sel_attri ).
But it does not work for me and I always get 1st node value.
Please help me in this issue.
-AshutoshHello ,
If you implementing a simple tree ( not table tree ) and you want the selected element for
OnLoadChildren event .
Then create an importing parameter CONTEXT_ELEMENT of type IF_WD_CONTEXT_ELEMENT
in the event handler of onLoadChildren .
Webdynpro framework automatically filled up the context element with the current node in the tree .
I tried it , It really worked for me .
If you have a table tree then you need to create an importing parameter PATH of type String in tha event handler .
Webdynpro frame automatically fills the PATH .
the use can use the following method to get the element from the PATH .
wd_context->path_get_element( path ).
I tried it , It also worked for me .
Regards
Vivek
PS : please provide the points if answer is helpful . -
Check result for Data Type: PriceDerivationType | http://alfuttaim.com/xi/storeConnectivity:
Data type Data Type PriceDerivationType | http://alfuttaim.com/xi/storeConnectivity points to itself
Hi Experts ,
I have a datatype part of sap standard content which has a recursive node ( poniting to itself).
I have to copy it to a local name space and use it . When i try to copy it and activate it i am getting this
error .
"Check result for Data Type: PriceDerivationType | http://alfuttaim.com/xi/storeConnectivity:
Data type Data Type PriceDerivationType | http://alfuttaim.com/xi/storeConnectivity points to itself"
Please let me know how do i go abt activating this object.
Thanks in advance and best regards,
AnilHi Anil,
When you copy it local namespace, verify the namespace is local or the one which is poiting to itself.
If this is pointing itself, manually you change the namespace which you want and activate it.
Hope this helps.
Regards
Shankar. -
Hello PI people.
I have a problem reguarding to a XSD file (standard DSML found here: [DSMLv2|http://www.oasis-open.org/committees/dsml/docs/DSMLv2.xsd]).
When I Import it as external definition to PI Integration builder it all works fine but if I undfold the message "Filter" the there is problem with the defintions for "not" and after one more fold on "and" or "or" the same problem is shown. It looks like PI understands the XSD but it just not permit recursive nodes?
Is it the XSD that dosent meet the PI standard or is it a internal thing in PI that needs to be activated to handle recursive nodes i XSD?
(When a message is mapped with this DSML all the error prone nodes are stripped..)
// JesperHello Jesper,
You can refer to this document for supported XSD and WSDL:
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00a9a425-1769-2a10-9196-bd8eeed72e4c
Once you open this excel document go to row 94 for Recursive Data Structures, it says it is supported but there is a reference to row 143 which says
Recursive data structure must be expanded in design-time manually to the desired depth
If what you are thinking is dynamic recursion, then it is not possible. You have to use Java Mapping/XSLT for that. Now as for the nodes not displaying, right-click on the node and then select expand recursive structure.
Hope this helps,
Mark -
Loop through tree node children recursively
Is there an easy way of looping through all the child nodes of a MutableTreeNode and the children of those children if they have any?
ThanksWith a recursive function (this is depth first):
public void traverse(Node node) {
// do something with node
for(Node child : node.getChildren()) {
traverse(child);
}You could also look at depthFirst/breathFirst/preorder/postorderEnumeration() methods on DefaultMutableTreeNode if that's what you actually got. -
How can I deal with recursive target nodes?
Hello All,
I am working on an IDOC to B2MML scenario.
I need to map E1PLPOL segment to a recursive node - product segment - on the target side.
The initial occurrence of product segment node will be the operations and the child product segment node under it will be the phases.
When I test the message mapping, I can see one successful occurrence of the operations and phases.
But, when I give values for subsequent occurrences of operations and phases, I am able to see the operations alone. What could be the reason for the phases to miss out from the second iteration onwards?
Any help would be deeply appreciated.
Warm Regards,
EarnestHi Ibrahim,
Here is the source tree structure:
MT_NEW_TEST
- E1PLPOL
--VORNR
--PVZNR
Target tree structure is as given below:
MT_INT_MR1
-OPERATIONS
--OVORNR
--OPVZNR
---PHASES
PVORNR
PPVZNR
Test data for source side is given below:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_NEW_TEST xmlns:ns0="http://hclcoe/PIPs">
<E1PLPOL>
<VORNR>10</VORNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>20</VORNR>
<PVZNR>10</PVZNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>30</VORNR>
<PVZNR>10</PVZNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>40</VORNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>50</VORNR>
<PVZNR>40</PVZNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>60</VORNR>
<PVZNR>40</PVZNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>70</VORNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>80</VORNR>
<PVZNR>70</PVZNR>
</E1PLPOL>
<E1PLPOL>
<VORNR>90</VORNR>
<PVZNR>70</PVZNR>
</E1PLPOL>
</ns0:MT_NEW_TEST>
The following is what I got on the target side:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_INT_MR1 xmlns:ns0="http://hclcoe/PIPs">
<Operations><OVORNR>10</OVORNR>
<Phases><PVORNR>20</PVORNR><PPVZNR>10</PPVZNR></Phases>
<Phases><PVORNR>30</PVORNR><PPVZNR>10</PPVZNR></Phases>
<Phases><PVORNR>50</PVORNR><PPVZNR>40</PPVZNR></Phases>
<Phases><PVORNR>60</PVORNR><PPVZNR>40</PPVZNR></Phases>
<Phases><PVORNR>80</PVORNR><PPVZNR>70</PPVZNR></Phases>
<Phases><PVORNR>90</PVORNR><PPVZNR>70</PPVZNR></Phases>
</Operations>
<Operations><OVORNR>40</OVORNR></Operations>
<Operations><OVORNR>70</OVORNR></Operations>
</ns0:MT_INT_MR1>
The condition to map the phases under the operation is: "VORNR value should match the PVZNR value".
So, in the above sample, the operations would be 10, 40 & 70. I am struggling to group the respective phases under the operations using the condition mentioned above.
Thanks a lot,
Earnest
Edited by: Earnest Thomas on Nov 30, 2008 9:56 AM
Edited by: Earnest Thomas on Nov 30, 2008 9:57 AM
Edited by: Earnest Thomas on Nov 30, 2008 9:59 AM -
Reading and modifying data in a recursive node
Hi All,
I am using a TreeByNesting column in a table UI element of my component.
For this purpose I have created a node in the context - ('TREE') which contains a recursive node - ('RECURSIVE_TREE').
What would be the simplest way to read the data from this node ? And how do I go about changing a single line of information
within the node ?
Thanks,
FathimaWhat would be the simplest way to read the data from this node?
Reading data from a recursive node is no different to reading any normal node. It's just that you have a very simple way of holding the same structure.
Once you have a reference to the element of a node (a single line of data), then updating it is no different to updating a line of a table.
More issues are associated with making and setting lead selections for an element (all parent elements also need to be lead selected and no child elements). Searching through the hierarchy, etc.
Where I have used this functionality I have often set up search tables with the key data that I want to search in a flat table and a reference to the corresponding element - much easier to search then - without having to resort to recursive coding!
Could you elaborate a little on what exactly you are having an issue with?
Cheers,
Chris -
WD ABAP: Lead selection on a recursive node
Hi,
I would like to know if lead selection is permitted on a recursive node in WD ABAP.
As of now, methods 'set_lead_selection_index' or 'set_lead_selection' do not cause lead selection to change in my view, and the lead selection rests only with the first row in my table..(I have set the rowSelectable property to YES for my table.)
Also, method call 'set_selected' performed on my target element does not solve the problem.
Any help much appreciated!
Best Regards.Hi Adithya,
Yes, you can have a leadSelection on a recursive node and it can be changed by the same methods that are used for non-recursive ones.
Best regards,
Thomas -
WD ABAP: Recursion Nodes that Repeat Tree Nodes with Embedded Tables ???
At Rich H's suggestion, I'm posting this here as well as in the blogs.
Suppose you've got a tree context with a node that has a table embedded under it. (For example, the TREE_WITH_TABLE view of WDR_TEST_EVNT has this kind of context substructure.) Call this node "NODE_WITH_TABLE."
You now define a recursion node underneath "NODE_WITH_TABLE" and specify "NODE_WITH_TABLE" as the repeated node for this recursion node. Call this recurion node "RECURSION_NODE".
Lo and behold - the table fills properly when you're on any instance of "NODE_WITH_TABLE", but not when you're on an instance of "RECURSION_NODE".
I'm hoping that:
a) I'm doing something wrong;
OR
b) There's an easy work-around/alternative I'm not seeing
OR
c) SAP will give recursion nodes enough memory to carry any table(s) embedded in the nodes they're repeating.
'Cause I sure don't want to have to define "n" levels of tree-nodes that have different copies of the same table(s) embedded in them.
Message was edited by: Armin Reichert/people/david.halitsky/blog/2006/08/16/recursion-nodes-that-repeat-tree-nodes-with-embedded-tables-in-wd-abap-not
Maybe you might want to back out your weblog as it is not really a place to ask these types of questions. Think of it this way, if you are allowed to do this type of weblog, what is stopping any other weblogger. Hence the weblogs would just be another forum, which I don't think anyone wants.
Regards,
Rich Heilman -
Hi........
Like I am not Able to Create Recursive Node. it is giving Error. Type Comfortable.
Please Tell Me solution ...You may have to explain lot more than this,so that we can understand and help you effective.
What you do exactly? from where you are trying to do ? explain it in step step what you have done so for and also post the exact message.
You must be making somewhere a mistake. This is not a kind of error i hear often. -
Hi everybody,
i would like to ask if it is posiible to map context node with recursive node from controller to view. I try to do that by the recursive subnode is disabled. When that is not possible can that any one explain why?
Regards
BogdanHello Bogdan,
Recursive context nodes cannot be mapped. You may refer this <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/ea/a5384162316532e10000000a1550b0/frameset.htm">article</a>
Best Regards,
Bala
Maybe you are looking for
-
One Apple ID, 2 iMacs...separate iTune accts?
Our family has one Apple ID and 2 iMacs. Can we have 2 separate iTunes accts, one for each iMac, w separate ID's? .... or must we sign in on both iMacs using my apple ID to purchase & redeem? Just trying to keep 'mine' and 'theirs' separate.
-
As explained above, my system keeps asking me to fix my iCloud preferences for my old and new AppleID since it's not backing up my files. I don't have access to my old email address and don't have my password for my old AID. How can I delete this and
-
I have read about this happening, but the only solution is for people who use Norton, and I do not-it is not even on my laptop at all.. I have firefox 4.0. Every time I close firefox, some of my SAVED bookmarks are missing when I re-open later. I tri
-
html accompanies text, and is embedded in microsoft Word
-
PO change didnt transfer to corresponding SO via IDOC.
Hi, I created an PO and using IDOC to create corresponding SO in the system. The first time,the PO created with 1 item and the IDOC is triggered and the corresponding SO wtih 1 item is generated by this IDOC successfully. But the second time, if i ch