Navigate to component via anchor?

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

Navigate to component via anchor?

Boris Popov, DeepCove Labs (SNN)
I finally got around to building a simple navigation that I was thinking of
yesterday,

|-------------------|
|     Header        |
|-------------------|
|                   |
|          |-------||
| Home     | .0.0. ||
| Register | ..0.. ||
| Login    | .0.0. ||
| FAQ      | ..0.. ||
|          |-------||
|                   |
|----------|--------|

Everything works as expected, but I'm having trouble rendering links inside
of main canvas that navigate somewhere else. Say 'Home' is selected by
default displaying WelcomePage component in the main area. Inside the
WelcomePage I want to render a link to LoginPage component, but if I do it
via "html anchor callback: [self call: LoginPage new]" it works and shows me
the login page, but now whenever I click on 'Home' in the menu, I see a
login component, not a welcome page. Its hard being newb ;)

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Navigate to component via anchor?

Boris Popov, DeepCove Labs (SNN)
Okay, I figured call isn't the right thing to do because the call'ed
component will retain control until it answers. Fair enough. Now I'm back to
the idea of setting the 'menu' variable on the 'component' so that
components could ask the menu to do the navigation for them. Ouch! Somebody
tell me there's a better way to do this, its not immediately obvious to me
what to do here...

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Boris Popov
Sent: Wednesday, May 24, 2006 2:59 PM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: [Seaside] Navigate to component via anchor?

I finally got around to building a simple navigation that I was thinking of
yesterday,

|-------------------|
|     Header        |
|-------------------|
|                   |
|          |-------||
| Home     | .0.0. ||
| Register | ..0.. ||
| Login    | .0.0. ||
| FAQ      | ..0.. ||
|          |-------||
|                   |
|----------|--------|

Everything works as expected, but I'm having trouble rendering links inside
of main canvas that navigate somewhere else. Say 'Home' is selected by
default displaying WelcomePage component in the main area. Inside the
WelcomePage I want to render a link to LoginPage component, but if I do it
via "html anchor callback: [self call: LoginPage new]" it works and shows me
the login page, but now whenever I click on 'Home' in the menu, I see a
login component, not a welcome page. Its hard being newb ;)

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Navigate to component via anchor?

Ramon Leon
In reply to this post by Boris Popov, DeepCove Labs (SNN)
>
> Okay, I figured call isn't the right thing to do because the
> call'ed component will retain control until it answers. Fair
> enough. Now I'm back to the idea of setting the 'menu'
> variable on the 'component' so that components could ask the
> menu to do the navigation for them. Ouch! Somebody tell me
> there's a better way to do this, its not immediately obvious
> to me what to do here...
>
> Thanks!
>
> -Boris

Small hint... You don't always have to say "self call:", you can say
"mainArea call:", and only that area will be replaced by the called
component.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Navigate to component via anchor?

Ramon Leon
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Disregard my previous, I didn't read your issue close enough before
hitting send.  If your main menu loads the mainArea with the existing
component each time, then you'll have the issue you're having...
Components remember their state.  Have your main menu load a new
component each time it's clicked, your problem should go away.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of Ramon Leon
> Sent: Wednesday, May 24, 2006 4:05 PM
> To: The Squeak Enterprise Aubergines Server - general discussion.
> Subject: RE: [Seaside] Navigate to component via anchor?
>
> >
> > Okay, I figured call isn't the right thing to do because
> the call'ed
> > component will retain control until it answers. Fair
> enough. Now I'm
> > back to the idea of setting the 'menu'
> > variable on the 'component' so that components could ask
> the menu to
> > do the navigation for them. Ouch! Somebody tell me there's a better
> > way to do this, its not immediately obvious to me what to do here...
> >
> > Thanks!
> >
> > -Boris
>
> Small hint... You don't always have to say "self call:", you
> can say "mainArea call:", and only that area will be replaced
> by the called component.
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Navigate to component via anchor?

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Right, except that in my case #call would retain control, not merely
navigate away to the new component. I changed it to go through the parent
menu,

self anchor
        callback: [self menu selectComponent: ContactPage];
        with: [html text: 'Contact Us'].

Ugly, but it works. I'm all ears to hear better suggestions.

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Ramon Leon
Sent: Wednesday, May 24, 2006 4:05 PM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: RE: [Seaside] Navigate to component via anchor?

>
> Okay, I figured call isn't the right thing to do because the
> call'ed component will retain control until it answers. Fair
> enough. Now I'm back to the idea of setting the 'menu'
> variable on the 'component' so that components could ask the
> menu to do the navigation for them. Ouch! Somebody tell me
> there's a better way to do this, its not immediately obvious
> to me what to do here...
>
> Thanks!
>
> -Boris
Small hint... You don't always have to say "self call:", you can say
"mainArea call:", and only that area will be replaced by the called
component.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Navigate to component via anchor?

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Gotcha, that may just work, in which case this'll be one of the typical
"D'oh" moments.

Thanks,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Ramon Leon
Sent: Wednesday, May 24, 2006 4:12 PM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: RE: [Seaside] Navigate to component via anchor?

Disregard my previous, I didn't read your issue close enough before
hitting send.  If your main menu loads the mainArea with the existing
component each time, then you'll have the issue you're having...
Components remember their state.  Have your main menu load a new
component each time it's clicked, your problem should go away.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of Ramon Leon
> Sent: Wednesday, May 24, 2006 4:05 PM
> To: The Squeak Enterprise Aubergines Server - general discussion.
> Subject: RE: [Seaside] Navigate to component via anchor?
>
> >
> > Okay, I figured call isn't the right thing to do because
> the call'ed
> > component will retain control until it answers. Fair
> enough. Now I'm
> > back to the idea of setting the 'menu'
> > variable on the 'component' so that components could ask
> the menu to
> > do the navigation for them. Ouch! Somebody tell me there's a better
> > way to do this, its not immediately obvious to me what to do here...
> >
> > Thanks!
> >
> > -Boris
>
> Small hint... You don't always have to say "self call:", you
> can say "mainArea call:", and only that area will be replaced
> by the called component.
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Navigate to component via anchor?

Avi  Bryant
In reply to this post by Boris Popov, DeepCove Labs (SNN)

On May 24, 2006, at 4:13 PM, Boris Popov wrote:

> Right, except that in my case #call would retain control, not merely
> navigate away to the new component. I changed it to go through the  
> parent
> menu,
>
> self anchor
> callback: [self menu selectComponent: ContactPage];
> with: [html text: 'Contact Us'].
>
> Ugly, but it works. I'm all ears to hear better suggestions.

That seems reasonable to me.  Depending on what you find uglier, you  
could store the menu in the session (effectively make it a global)  
rather than on every component...

Note that the combination of #with: and #text: can always be  
abbreviated:

self anchor
          callback: [self menu selectComponent: ContactPage];
          with: 'Contact Us'

Avi
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Navigate to component via anchor?

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Thanks, Avi, saving it on the session may actually work nicer as I really
don't like carrying the same thing around.

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Avi Bryant
Sent: Wednesday, May 24, 2006 4:16 PM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: Re: [Seaside] Navigate to component via anchor?


On May 24, 2006, at 4:13 PM, Boris Popov wrote:

> Right, except that in my case #call would retain control, not merely
> navigate away to the new component. I changed it to go through the  
> parent
> menu,
>
> self anchor
> callback: [self menu selectComponent: ContactPage];
> with: [html text: 'Contact Us'].
>
> Ugly, but it works. I'm all ears to hear better suggestions.
That seems reasonable to me.  Depending on what you find uglier, you  
could store the menu in the session (effectively make it a global)  
rather than on every component...

Note that the combination of #with: and #text: can always be  
abbreviated:

self anchor
          callback: [self menu selectComponent: ContactPage];
          with: 'Contact Us'

Avi
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

smime.p7s (4K) Download Attachment