on 04-25-2007 10:05 AM
Hi ,
I am having the following problems with external context mapping from one WD component to another.
Problem description:
In the <i>Component Interfaces</i> I have defined a WD interface "InfA".
In the <i>interface controller</i> of this compoenent,I have ContextA and attributeA(cardinality 1..1).The contextA is marked as an "Input Element".
Now my webdynpro componentB adds InfA as used component.In componentB I decalre a contextB with attributeB and map it to contextA to set up the external context mapping.
Now I expect that if any webdynpro component implements this WD interface InfA ,he has access to contextA with the data getting filled from contextB.
After i have created the component for the used component I try to fill values in the source node contextB thru this code:
wdContext.currentContextB.setB(value);
But in the runtime I keep getting error nullPointerException for nodeContextB,suggesting that the mapping has not been completed.
Can anyone suggest due to what the error can come ,and, if its a webdynpro bug ,is there a workaround??
Thanks in advance for your help.
Best regards
Sourav
Hi All,
Thnaks for the answers,but the problem still remains.
I tried both the methods that you mentioned ,
First ,I kept the name of the context nodes and attributes in the using controller same as that of the Interface controller.
Second,during mapping I chose each node and attribute to be mapped separately.
But I still get java.lang.NullPointerException when I try to access the nodeElement
although the cardinality of the node is 1..1.
@Abhijeet
Thanks for the link to the doc,but I think i have done all the things right as mentioned in the document.
Please let me know if I am going wrong anywer.
Best regards
Sourav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Valery : I personally checked by doing the example, if the names of value attribute are different in the child's interface and parents component controller then it throws the exception.
Sourav: NullPointer Exception is thrown when something is not properly initialised, if in the main component the cardinality of mapped origin is 1.1 then you need to access it element directly like:
wdContext.currentParentNodeElement().setFname("Abhijeet");
wdContext.currentParentNodeElement().setLname("M");
i will suggest just check out if you are declaring some element of value node and without initialising taking its use or what?
if this doesnt solve your problem, please post the expanded exception.
hope it helps
let me know if you face nay problem
regards
Sourav,
In your outer component (componentB) where is contextB node defined? Component controller? Other controller?
If it's declared somewhere outside component controller, then try to "move" it to component controller. Probably this issue is related to lifecycle of controllers.
Valery Silaev
SaM Solutions
Hi,
@Abhijeet:I do access the elemnts as
"wdContext.currentUIAdjustmentObjectElement().setEnabled(editMode);"
in my code.
But the error is there as wdContext.currentUIAdjustmentObjectElement() returns null(checked in debugger).
@Valery:Checked in another thread and seems to be a bug.Workaround is suggested but not sure about the solution.
Please take a look here and suggest if you get the solution.
Hi Sourav,
check out this document for <b>External Context Mapping</b> :
http://help.sap.com/saphelp_nw04/helpdata/en/d7/e551cf896c3a49bb87bb4ce38c99c8/content.htm
hope it will solve your issue
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
External mapping require "node attribute" in both parent and child node to be same. in your case childs of contextA and contextB should be same ,
and in main component, in used conmponent , in its interface controller have you added component of contextB as required component?
just check it out
regards
Message was edited by:
Abhijeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<i>External mapping require the data attribute name in both parent and child node to be same</i>
Wrong. You may use any names, only types/cardinality matters.
The only glitch is that "automatic" mapping is not performed in designer when attributes has differenet name. I advise author to revisit his mapping -- select concrete attribute (not whole node) in component usage, then map it individually.
Valery Silaev
SaM Solutions
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.