Component navigation

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

Component navigation

keropotter
Hi!!

I'm wondering what's the best option to navigate a series of components in GLASS. For instance, i'm developing a solution using anchors, and the callbacks use the #call: message to render the next component.

But this makes me worry about the stack. Won't it grow indefintely and eventually crash my application? I'm never giving an #answer, because I don't know if the user will go back to the previous component. For example, the user might be on one called component, and navigate via menu to another component that's not related to the previous one.

So, what's the best way to navigate components in seaside? Would using a Task be a good approach? Any suggestions on how to do this? I'm kinda stuck here...

Many thanks in advance!!!
Reply | Threaded
Open this post in threaded view
|

Re: Component navigation

jgfoster
Hi,

The approach I use is to have a 'main' component that basically has a single child component and use the anchor callbacks to change the child component. See http://seaside.gemstone.com/tutorial/chapter10.pdf for an example in my tutorial.

James Foster

On Aug 29, 2011, at 2:12 PM, keropotter wrote:

> Hi!!
>
> I'm wondering what's the best option to navigate a series of components in
> GLASS. For instance, i'm developing a solution using anchors, and the
> callbacks use the #call: message to render the next component.
>
> But this makes me worry about the stack. Won't it grow indefintely and
> eventually crash my application? I'm never giving an #answer, because I
> don't know if the user will go back to the previous component. For example,
> the user might be on one called component, and navigate via menu to another
> component that's not related to the previous one.
>
> So, what's the best way to navigate components in seaside? Would using a
> Task be a good approach? Any suggestions on how to do this? I'm kinda stuck
> here...
>
> Many thanks in advance!!!
>
> --
> View this message in context: http://forum.world.st/Component-navigation-tp3777414p3777414.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> 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: Component navigation

Robert Sirois
Announcements. They can be used with James' method, too.

RS

> Subject: Re: [Seaside] Component navigation
> From: Smalltalk@JGFoster.net
> Date: Mon, 29 Aug 2011 14:31:47 -0700
> To: seaside@lists.squeakfoundation.org
>
> Hi,
>
> The approach I use is to have a 'main' component that basically has a single child component and use the anchor callbacks to change the child component. See http://seaside.gemstone.com/tutorial/chapter10.pdf for an example in my tutorial.
>
> James Foster
>
> On Aug 29, 2011, at 2:12 PM, keropotter wrote:
>
> > Hi!!
> >
> > I'm wondering what's the best option to navigate a series of components in
> > GLASS. For instance, i'm developing a solution using anchors, and the
> > callbacks use the #call: message to render the next component.
> >
> > But this makes me worry about the stack. Won't it grow indefintely and
> > eventually crash my application? I'm never giving an #answer, because I
> > don't know if the user will go back to the previous component. For example,
> > the user might be on one called component, and navigate via menu to another
> > component that's not related to the previous one.
> >
> > So, what's the best way to navigate components in seaside? Would using a
> > Task be a good approach? Any suggestions on how to do this? I'm kinda stuck
> > here...
> >
> > Many thanks in advance!!!
> >
> > --
> > View this message in context: http://forum.world.st/Component-navigation-tp3777414p3777414.html
> > Sent from the Seaside General mailing list archive at Nabble.com.
> > _______________________________________________
> > seaside mailing list
> > seaside@lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
>
> _______________________________________________
> seaside mailing list
> seaside@lists.squeakfoundation.org
> 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: Component navigation

Ramon Leon-5
In reply to this post by keropotter
On 08/29/2011 02:12 PM, keropotter wrote:
> Hi!!
>
> I'm wondering what's the best option to navigate a series of components in
> GLASS. For instance, i'm developing a solution using anchors, and the
> callbacks use the #call: message to render the next component.

Use #show: instead of #call:, only use #call: when you intend to #answer.

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

Re: Component navigation

Philippe Marschall
In reply to this post by keropotter
2011/8/29 keropotter <[hidden email]>:
> Hi!!
>
> I'm wondering what's the best option to navigate a series of components in
> GLASS. For instance, i'm developing a solution using anchors, and the
> callbacks use the #call: message to render the next component.
>
> But this makes me worry about the stack. Won't it grow indefintely and
> eventually crash my application?

No, the stacks are not joined together and only a limited set of
continuations is kept.

> I'm never giving an #answer, because I
> don't know if the user will go back to the previous component. For example,
> the user might be on one called component, and navigate via menu to another
> component that's not related to the previous one.

If you're just changing the 'main' content component then see the
answers of James and Robert.

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

Re: Component navigation

keropotter
Thank you all very much! You've been of great help!

I'll focus on James and Robert approaches, although I'm not sure what Announcements are. I'll search some info on that =)

Thanks you again!!
Alejandro

On Tue, Aug 30, 2011 at 8:29 AM, Philippe Marschall <[hidden email]> wrote:
2011/8/29 keropotter <[hidden email]>:
> Hi!!
>
> I'm wondering what's the best option to navigate a series of components in
> GLASS. For instance, i'm developing a solution using anchors, and the
> callbacks use the #call: message to render the next component.
>
> But this makes me worry about the stack. Won't it grow indefintely and
> eventually crash my application?

No, the stacks are not joined together and only a limited set of
continuations is kept.

> I'm never giving an #answer, because I
> don't know if the user will go back to the previous component. For example,
> the user might be on one called component, and navigate via menu to another
> component that's not related to the previous one.

If you're just changing the 'main' content component then see the
answers of James and Robert.

Cheers
Philippe
_______________________________________________
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: Component navigation

fstephany
> I'll focus on James and Robert approaches, although I'm not sure what
> Announcements are. I'll search some info on that =)

This should help:
http://book.seaside.st/book/components/embedding/coupling
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Component navigation

Robert Sirois
This is the method I use, although there are plenty of uses:

WASession#initialize
super initialize.
announcer := Announcer new.

WASession#on: announcement send: method to: object
announcer 
on: announcement 
send: method
to: object

AnAnnouncementSubclass class #on: payLoad
^(self new) payload: payLoad; yourself.

AComponent#initialize
super initialize.
self session on: AnAnnouncementSubclass send: #onChangeContent: to: self.

AComponent#children
^Array with: self content.

AComponent#onChangeContent: anAnnouncement
self content: anAnnouncement payload.

Then call it this way:

self session announce: (AnAnnouncementSubclass on: WACounter new).

RS

> Date: Tue, 30 Aug 2011 16:26:17 +0200

> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Seaside] Component navigation
>
> > I'll focus on James and Robert approaches, although I'm not sure what
> > Announcements are. I'll search some info on that =)
>
> This should help:
> http://book.seaside.st/book/components/embedding/coupling
> _______________________________________________
> 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