Revealing child presenter in parent

47 views
Skip to first unread message

Boris Morris

unread,
Jan 13, 2016, 6:11:01 AM1/13/16
to GWTP, Lukas Krupa
I having some confusion with nested presenters.

A bit of background - we have an application that has a "root presenter" (RP) which contains a number of elements:
  • a "top links" (TL) panel;
  • an "header" (H) panel;
  • a "content" (C) panel;
  • a "footer" (F) panel; and
  • and a "bottom links" (BL) panel
The setup we currently have is that TL, H, F and BL are all PresenterWidget types and are Gin-injected into the RP which uses setInSlot to display them.  The C panel then filled by one of a number of different Presenters, this is done using the place framework. Each C has a placetoken and we navigate successfully between different widget.

Now; we are trying to split the application up - lets say we have a "peon" user (P) and an "admin" user (A), we want to create two separate applications with a common code base.  For the C Presenters that is very simple - we just split them out to another Maven project, add the RP as a dependency and hey presto!

But P and A have different TL content; this was (hackisly) decided by the RP (yes, server side validation too) and it then used setInSlot to display the appropriate PresenterWidget in TL.

What we have to do is de-couple the TL PresenterWidgets from RP.  So, we have (experimentally):
  1. converted one TL into a Widget with a Proxy (not ProxyPlace)
  2. added RP.TL as the slot
  3. removed the injection, setInSlot from RP
The result is that TL is now empty...

So, the question is:

How do I reveal is Presenter that is not a Place in a parent Presenter?

I have tried a number of things, and they don't seem to do very much:
  1. call revealInParent from the TL Presenter - this does nothing in the ctor and causes in infinite loop in onBind
  2. call forceReveal - same as above (no surprise really)
  3. manually fire RevealContentEvent in the ctor - this does nothing
  4. create an eager singleton in Gin that has the TL Presenter injected and fires RevealContentEvent - this does nothing
  5. create an eager singleton in Gin that has the TL Presenter injected and calls revealInParent - this does nothing

At this point I feel that I am doing something very wrong or being decidedly obtuse - Help!
Reply all
Reply to author
Forward
0 new messages