subscribing problem

0 views
Skip to first unread message

tqwhite

unread,
Oct 1, 2010, 1:21:48 PM10/1/10
to JavaScriptMVC

I have an event that one class is not getting even though lots of
others do. The subscribe method is built into a base class that I add
to the controller prototype.

Any quick ideas about what might be wrong with that one controller?

thanks,
tqii

Alexandre Gomes

unread,
Oct 1, 2010, 1:28:06 PM10/1/10
to javasc...@googlegroups.com
You mean you're not using controller/subscribe?




--
You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
To post to this group, send email to javasc...@googlegroups.com.
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.


Justin Meyer

unread,
Oct 1, 2010, 1:33:49 PM10/1/10
to javasc...@googlegroups.com
Yeah, I'm not sure what you mean b

Sent from my iPhone

tqwhite

unread,
Oct 1, 2010, 1:39:55 PM10/1/10
to JavaScriptMVC

I have this:

'universalCancelLogin subscribe':function(ev, options){ ... },

in my controller prototype. When I publish:

this.publish('universalCancelLogin');

Many controllers receive it. One of them doesn't. I can't figure out
why.

tqii



On Oct 1, 12:33 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> Yeah, I'm not sure what you mean b
>
> Sent from my iPhone
>

Justin Meyer

unread,
Oct 1, 2010, 1:46:59 PM10/1/10
to javasc...@googlegroups.com
Have you added your controller to an element?

Sent from my iPhone

Alexandre Gomes

unread,
Oct 1, 2010, 1:49:59 PM10/1/10
to javasc...@googlegroups.com
And forgot to remove onDocument:true?

tqwhite

unread,
Oct 1, 2010, 2:06:11 PM10/1/10
to JavaScriptMVC

The controller is assigned to an element and does lots of really good
work. I was all excited by the onDocument suggestion, but, I'm
disappointed to say, there's no mention of onDocument in the
controller.

This is the kind of stuff that makes me crazy.

If you have any more ideas, let me know. I'll keep trying things.

tqii


On Oct 1, 12:49 pm, Alexandre Gomes <alexandre.r...@gmail.com> wrote:
> And forgot to remove onDocument:true?
>
> On Fri, Oct 1, 2010 at 12:46 PM, Justin Meyer <justinbme...@gmail.com>wrote:
>
>
>
> > Have you added your controller to an element?
>
> > Sent from my iPhone
>
> > On Oct 1, 2010, at 12:39 PM, tqwhite <tqwh...@gmail.com> wrote:
>
> > > I have this:
>
> > >      'universalCancelLogin subscribe':function(ev, options){ ... },
>
> > > in my controller prototype. When I publish:
>
> > >     this.publish('universalCancelLogin');
>
> > > Many controllers receive it. One of them doesn't. I can't figure out
> > > why.
>
> > > tqii
>
> > > On Oct 1, 12:33 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> > >> Yeah, I'm not sure what you mean b
>
> > >> Sent from my iPhone
>
> > >> On Oct 1, 2010, at 12:21 PM, tqwhite <tqwh...@gmail.com> wrote:
>
> > >>> I have an event that one class is not getting even though lots of
> > >>> others do. The subscribe method is built into a base class that I add
> > >>> to the controller prototype.
>
> > >>> Any quick ideas about what might be wrong with that one controller?
>
> > >>> thanks,
> > >>> tqii
>
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> > Groups "JavaScriptMVC" group.
> > >>> To post to this group, send email to javasc...@googlegroups.com.
> > >>> To unsubscribe from this group, send email to
> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog legroups.com>
> > .
> > >>> For more options, visit this group athttp://
> > groups.google.com/group/javascriptmvc?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "JavaScriptMVC" group.
> > > To post to this group, send email to javasc...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog legroups.com>
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/javascriptmvc?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "JavaScriptMVC" group.
> > To post to this group, send email to javasc...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog legroups.com>
> > .

tqwhite

unread,
Oct 1, 2010, 2:37:48 PM10/1/10
to JavaScriptMVC

Could it be a namespace thing?

The controller that sends the logout event is in a different universe
from the one that won't catch it. I have discovered that none of the
controllers in the dysfunctional branch are receiving the event (they
happen to have no responsibilities in this one).

My folder/namespace structure is like this:

toplevelfolder
appcontrollers
group1folder
brokencontrollerfolder
broken_controller.js
views

systemcontrollers
loginfolder
login_controller
views

The class names are, respectively:

TopLevelfolder.Appcontrollers.Group1folder.Brokencontrollercolder.Broken

TopLevelfolder.Systemcontrollers.Loginfolder.Login

Is this a clue?

tqii

Joseph Tate

unread,
Oct 1, 2010, 5:28:05 PM10/1/10
to javasc...@googlegroups.com
This is a really stupid suggestion, but it bit me for long time once.
Did you remember the " subscribe" on the end of your controller
method? Make sure you spelled it consistently? Are any other
subscribed methods working in that controller?

> --
> You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
> To post to this group, send email to javasc...@googlegroups.com.

> To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.
>
>

--
Joseph Tate
Personal e-mail: jtate AT dragonstrider DOT com
Web: http://www.dragonstrider.com

Reply all
Reply to author
Forward
0 new messages