cancel
Showing results for 
Search instead for 
Did you mean: 

External Context Mapping

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

Are your context of both the DC components mapped?

Regards,

Murtuza

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Can you try to take a view set and place the view of the usingDC in one view area the interface view of the used DC in the second view area. I have worked on this scenario and I was successfully able to pass data between them

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

I just tried your guide, but unfortunately, I can not make it run.

I wish I can send you my sample project for helping me to debug.

Can I send you my source code.

Please help me out of here.

Thanks and best regards,

Vu

Former Member
0 Kudos

Ya sure. You can get my id from my profile.

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

Sorry that I can not find your id to contact out side of this forum, for e.g: yahoo ID or skype id.

If you could, please add me via skype: vudawson, or via Yahoo!IM: ngtranvu

Thanks and have a nice day.

Tran, Vu

Former Member
0 Kudos

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