on 03-17-2008 12:55 PM
Hi experts,
I have one static node in the controller.I mapped this static node SN with view1 and view2.
Now i created 3 dynamic attributes for this static node SN in the view2. Now i want to get these dynamic attributes in view1.
Please suggest me how to get the dynamic attributes from view2 to view1.
i tried with :-
wdContext.nodeSN.currentSNElement.getAttribute().
-
I tried with this code as well:-
Iterator it=wdContext.nodeNodeSN().getNodeInfo().iterateAttributes();
do{
String name=((IWDAttributeInfo)it.next()).getName();
wdComponentAPI.getMessageManager().reportSuccess(name);
}while(it.hasNext());
-
Its not working.
Regards
-Sandip
Hi experts,
I have one static node in the controller.I mapped this static node SN with view1 and view2.
Now i created 3 dynamic value attributes for this static node SN in the view2. Now i want to get these dynamic value attributes in view1.
i tried with :-
wdContext.nodeSN.currentSNElement.getAttribute().
-
I tried with this code as well:-
Iterator it=wdContext.nodeNodeSN().getNodeInfo().iterateAttributes();
do{
String name=((IWDAttributeInfo)it.next()).getName();
wdComponentAPI.getMessageManager().reportSuccess(name);
}while(it.hasNext());
-
Its not working.
Please suggest me how to get the dynamic value attributes from view2 to view1.
Regards
-Sandip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Do you create using AddAttribute method in the view2?
Use AddMappedAttribute instead of addAttribute.
for how to use AddMappedAttribute, please goto this link
Just suggestion,
Create the attribute (using AddAttribute) in controller, instead of in the View.
Then every View you need to do AddMappedAttribute.
Like this:
In Controller (wdDoInit):
wdContext.nodeTest().getNodeInfo().addAttribute("attr1", "ddic:com.sap.dictionary.string");
wdContext.nodeTest().getNodeInfo().addAttribute("attr2", "ddic:com.sap.dictionary.string");
IWDNodeElement elemGlb = wdContext.nodeTest().createElement();
elemGlb.setAttributeValue("attr1", "ABCDEF");
wdContext.nodeSurvey().addElement(elemGlb);
In the View (wdDoInit):
wdContext.nodeTest().getNodeInfo().addMappedAttribute("attr1InView", "attr1");
wdContext.nodeTest().getNodeInfo().addMappedAttribute("attr2InView", "attr2");
In the View (wdDoModifyView)
IWDGroup group = (IWDGroup) view.getElement("InputGroup");
IWDLabel theLabel = (IWDLabel)view.createElement(IWDLabel.class, "lbl1");
theLabel.bindText("text.attr1InView");
group.addChild(theLabel);
Regards
Hi Sandip
I agree with the bro above, and also addMappedAttribute is a quick way to solve ur requirement. But as i suggested, how about create all of your mapped nodes and attributes in controlers?
in controler:
create node and create attributes
in viewer:
mapping node and all its attributes
actually, u can define each viewer new attributes in ur mapped node attributes with attributeAccessor.
if u want the code example, please contact me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Tha mapping for the node N is done :-Controller -> View 1
and Controller -> View 2.
So node N is available in the context of view2.Now i created Dynamic value attributes(through code).,i repeat its not a static value attribute.
Now since this is not a static attribute,it will not get reflected in the contyext of View1.
Now what i want is ,i want to get those Dynamic attributes from View2 to view1.I think I m clear abt the requirement.
Please suggest .
Regards
-sandip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandip,
I don't really understand your requirement.
I assume you already create proper mapping between Controller -> View 1
and Controller -> View 2
My question:
1. When and how you add the element to the node?
usually I use this code (please check with your webdynpro intellisense)
IPrivateView1.IPrivateSNElement elem = wdContext.nodeSN.createElement();
wdContext.nodeSN().addElement(elem);
2. To get current Element, I only use wdContext.currentNodeElement.getZ***()
Z*** is your Attribute Name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Still this thread is not answer properly.
Can any one please suggest how to pass dynamic attribute values from one view to another view.
I tried with all possibe ways.Its urgent for me.
Please suggest.
Regards
-Sandip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.