createSchematicWiring problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

createSchematicWiring problem

Federico Balaguer-2
I found a problem while trying to register a Presenter as a dependent of
one of its subpresenters using
#when: send: to on the createSchematicWiring method (I don't have the
code in front of me, so I can have some typos...)

Well the problem seems to be that the view (a combo box)linked to the
subpresenter  (a list presenter )starts disable and then when it gets
enabled it doesn't propagate events to the registered observers... I had
to register the observer when it gets enable... but that defeats the
idea of having the createSchematicWiring.

I am doing something wrong ?

Thanks!
Federico


Reply | Threaded
Open this post in threaded view
|

Re: createSchematicWiring problem

Christopher J. Demers
<[hidden email]> wrote in message
news:[hidden email]...
...
> Well the problem seems to be that the view (a combo box)linked to the
> subpresenter  (a list presenter )starts disable and then when it gets
> enabled it doesn't propagate events to the registered observers... I had
> to register the observer when it gets enable... but that defeats the
> idea of having the createSchematicWiring.
...

I have not tried your specific issue, but I can't think of any reason why a
disabled combo box view should have any impact on event handlers since they
are set and triggered on the presenter.  Perhaps someone else can comment on
that situation.

However there is a very subtle mistake that could cause behavior similar to
what you are experiencing.  If you override #onViewOpened you need to do a
super send.  If you don't do this then #createSchematicWiring never gets
executed.  I think it might be handy for the compiler to at least raise a
warning if it sees an #onViewOpened method implemented in a Presenter
subclass without a super send.  It is an easy mistake to make and can be
very confusing to diagnose.

Hope this helps and good luck,

Chris


Reply | Threaded
Open this post in threaded view
|

Re: createSchematicWiring problem

Federico Balaguer-2
of course!

Thanks

"Christopher J. Demers" wrote:

> <[hidden email]> wrote in message
> news:[hidden email]...
> ...
> > Well the problem seems to be that the view (a combo box)linked to the
> > subpresenter  (a list presenter )starts disable and then when it gets
> > enabled it doesn't propagate events to the registered observers... I had
> > to register the observer when it gets enable... but that defeats the
> > idea of having the createSchematicWiring.
> ...
>
> I have not tried your specific issue, but I can't think of any reason why a
> disabled combo box view should have any impact on event handlers since they
> are set and triggered on the presenter.  Perhaps someone else can comment on
> that situation.
>
> However there is a very subtle mistake that could cause behavior similar to
> what you are experiencing.  If you override #onViewOpened you need to do a
> super send.  If you don't do this then #createSchematicWiring never gets
> executed.  I think it might be handy for the compiler to at least raise a
> warning if it sees an #onViewOpened method implemented in a Presenter
> subclass without a super send.  It is an easy mistake to make and can be
> very confusing to diagnose.
>
> Hope this helps and good luck,
>
> Chris

--
__________________________
Federico Balaguer
[hidden email]
http://www.uiuc.edu/ph/www/balaguer