Why don't you just store the current product as a field variable in the
class and in the onReset method you can just access the currentPlaceRequest
and compare them and then conditonally load the data.
On Tuesday, September 6, 2016 at 5:48:52 PM UTC+2, harshyadav wrote:
>
> This is a GWTP question, asking here as no answer on the GWTP
> group/stackoverflow.
>
>
> I have a Presenter (with Proxy), and I display multiple child presenters
> (with ProxyPlace) inside the parent presenter.
>
> Parent Presenter:
>
>
> @ProxyStandard
> @NoGatekeeper
> public interface MyProxy
> extends Proxy<ParentPresenter> {
> }
>
>
>
> Child Presenters:
>
> @NameToken (NameTokens.CHILD)
> @ProxyCodeSplit
> public interface MyProxy
> extends ProxyPlace<ChildPresenter> {
> }
>
>
>
> The parent presenter gets the common data and display it in the top main
> menu. So far so good.
> When the parent presenter gets the data, it uses the event bus to generate
> an event. The child presenters implements the handler to listen to the
> event.
>
> The issue is that I want the parent presenter to load the new common data,
> only on the place change i.e. when the URL parameter changes.
> Since the Proxy presenters don't implement prepareFromRequest, I cant do
> that in Parent Presenter.
>
> I can work around with that, by loading common data in either onReset() or
> by implementing a NavigationEvent in the parent presenter.
> However in that case, the data would be loaded unnecessarily, even when
> not needed.
>
> For e.g.
> if the URL parameter is product=1, the child presenters look like:
> #child1;product=1
> #child2;product=1
>
> I want the Parent Presenter to only request the new data, if the actual
> URL parameter changes.
> That is:
> Load new data if URL changes from:
> #child1;product=1 TO #child1;product=2
>
> OR
>
> #child1;product=1 TO #child2;product=2
>
>
> NOT when it changes from:
> #child1;product=1 TO #child2;product=1
>
>
> What I can do is check in the Parent Presenter, if the current history
> parameter is same or different than the previous one, and then load new
> data.
> But is there a better way to do this. I want to call my data service only
> when needed.
>
>
> Thanks,
> Harsh
>
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.