on 10-10-2007 5:13 AM
Hi experts,
Here is my scenario. I have 2 WDC. One is UsedWDC and another is UsingWDC. I will embedded the UsedWDC into the view of UsingWDC via controll ViewContainerUIElement.
I have the external context mapping between 2 WDC for the node Title and attribute Header. The cardinality of this node is 1..1. Normally, the value when I init in component controller of UsingWDC is mapped successfully to UsedWDC.
For e.g: I init and set String "Hello World" for attribute Header in the context of UsingWDC, set the external context mapping for UsingWDC and UsedWDC. Do data binding between the node Tilte.Header of the context of the view inside UsedWDC and the context of component controller of UsedWDC. At runtime, the value showed in the UsedWDC's view successfully.
However, when I accessing the value attribute of the node Title inside of component controller of UsedWDC, it raised me an <b>Null Pointer Exception</b>.
Please help me out of here, this scenario is also in my real project, and the deadline is coming. This is really urgent.
Thanks experts in advance.
Nguyen, Tran Vu
I tried your solution. But it still shows the error: null pointer exception.
I am sure that if in the component controller of the usedWDC I have no line of code like : String a = wdContext.currentTitleElement.getHeader(); , the application goes right the way as I want. But if I added that line of code. It raised the error.
I think, it because in the UsingWDC's view, I used the ViewContainerUIElement to embedded the view of UsedWDC, this instance of UsedWDC is different instance, so when I access it, it hase no instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For sure, it is mapped successfully. When I set value for Header in the component controller of UsingWDC. It is passed until the view of UsedWDC.
The issue is still If I added that line of code in the component controller of UsedWDC for accessing value of Header.
Thanks for your reply, Murtuza.
Regards,
Vu
Hi Tran,
You have only set the value of the attribute header in WDDoInit() of the component controller of the UsingWDC and haven't created an element of the title node.
You can create an element of the Title node(set Cardinality to 0:1) as follows:
IPrivate<viewname>.ITitleElement ele = wdContext.nodeTitle().createTitleElement();
ele.set<attribute>(<value>);
wdContext.nodeTitle().addElement(ele);
Now try accessing this node in the UsedWDC.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.