Skip to Content
0

WDA cross component communication

May 09, 2017 at 06:45 PM

70

avatar image

Dear Experts,

I'm using two components

Comp1 creates and instance of Comp2 in WDOINIT and passed over the assistance class

Comp1 hold the main contexts used in my application. Now Comp1 calls a dialog (Window > View) from Comp2. Comp1 is calling a method in Comp2 passing the key values needed to built the contexts used within Comp2. Now I struggle with invalidating the contexts that reside in Comp1 after Comp2 has performed changes that impact the display of Comp1.

I also tried to map the corresponding contexts via Interface Mapping from Comp1 into Comp2 and invalidate it there but without success. It seem that a new instance of Comp1 is created all the time I'm trying to access it.

Do you have a best practice approach for me that can be used in general to share data between components and keep the data in sync? If feasible, I would like to use an approach that also triggers a supply function to refresh the "global"-context?

Thanks in advance.

Christoph

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Mike Pokraka May 10, 2017 at 08:17 AM
1

Hi Christoph,

"I also tried to map the corresponding contexts via Interface Mapping from Comp1 into Comp2 and invalidate it there but without success. It seem that a new instance of Comp1 is created all the time I'm trying to access it."

As far as I know this is the 'correct' way, but I don't fully understand what you mean by new instance of Comp1? You map the nodes and then update Comp2's elements within Comp2. Changes should automatically apply within Comp1 (internally, mapped nodes point to the same data).

Regards,
Mike

Share
10 |10000 characters needed characters left characters exceeded
CHRISTOPH Nagy May 16, 2017 at 12:59 PM
0

Hi Mike,

thanks for your reply. Whenever I trigger the invalidate of context in comp2 which originates from comp1 I see no effect. Now I have implemented a dirty workaround. I transfer the comp_controller refrence from comp1 to comp2 and make use of get_api().

Regards,

Christoph

Show 1 Share
10 |10000 characters needed characters left characters exceeded

If it works, why not :-)

I wasn't 100% sure if an invalidate would propagate back, bit surprised that it doesn't. Another fallback solution is to have a flag attribute somewhere in the context.

0