Alternative to call:

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

Alternative to call:

jrick
This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?

Cheers,

Jeff

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

Re: Alternative to call:

Brad Selfridge
Would a redirect work?

Brad Selfridge
913-269-2385

> On Mar 27, 2015, at 11:40 AM, J.F. Rick <[hidden email]> wrote:
>
> This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?
>
> Cheers,
>
> Jeff
> _______________________________________________
> 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
Brad Selfridge
Reply | Threaded
Open this post in threaded view
|

Re: Alternative to call:

jrick
Maybe? :) What's a redirect? I can't really find that either. The main thing I found is this:
http://stackoverflow.com/questions/7977179/how-do-i-simply-redirect-to-another-toplevel-seaside-component

Cheers,

Jeff


On Fri, Mar 27, 2015 at 1:20 PM Brad <[hidden email]> wrote:
Would a redirect work?

Brad Selfridge
913-269-2385

> On Mar 27, 2015, at 11:40 AM, J.F. Rick <[hidden email]> wrote:
>
> This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?
>
> Cheers,
>
> Jeff
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Alternative to call:

jrick
Perhaps I figured it out. I just replaced
    self call: something
with
    self session presenter call: something
It works, but it may not be the right way to do this.

Cheers,

Jeff

On Fri, Mar 27, 2015 at 7:13 PM J.F. Rick <[hidden email]> wrote:
Maybe? :) What's a redirect? I can't really find that either. The main thing I found is this:
http://stackoverflow.com/questions/7977179/how-do-i-simply-redirect-to-another-toplevel-seaside-component

Cheers,

Jeff


On Fri, Mar 27, 2015 at 1:20 PM Brad <[hidden email]> wrote:
Would a redirect work?

Brad Selfridge
913-269-2385

> On Mar 27, 2015, at 11:40 AM, J.F. Rick <[hidden email]> wrote:
>
> This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?
>
> Cheers,
>
> Jeff
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Alternative to call:

Sven Van Caekenberghe-2
In reply to this post by jrick
WARequestContext>>#redirectTo:

As in

self requestContext redirectTo: '/browse'

> On 28 Mar 2015, at 00:13, J.F. Rick <[hidden email]> wrote:
>
> Maybe? :) What's a redirect? I can't really find that either. The main thing I found is this:
> http://stackoverflow.com/questions/7977179/how-do-i-simply-redirect-to-another-toplevel-seaside-component
>
> Cheers,
>
> Jeff
>
>
> On Fri, Mar 27, 2015 at 1:20 PM Brad <[hidden email]> wrote:
> Would a redirect work?
>
> Brad Selfridge
> 913-269-2385
>
> > On Mar 27, 2015, at 11:40 AM, J.F. Rick <[hidden email]> wrote:
> >
> > This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?
> >
> > Cheers,
> >
> > Jeff
> > _______________________________________________
> > 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

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

Re: Alternative to call:

jrick
Right, but, if I were to do a static url, it would be much easier just to use
    html anchor url: '/browse'
instead of
    html anchor callback: [ self requestContext redirectTo: '/browse' ]
I just want my top component replaced by the call rather than the component that issues the callback.

Cheers,

Jeff


On Fri, Mar 27, 2015 at 7:31 PM Sven Van Caekenberghe <[hidden email]> wrote:
WARequestContext>>#redirectTo:

As in

self requestContext redirectTo: '/browse'

> On 28 Mar 2015, at 00:13, J.F. Rick <[hidden email]> wrote:
>
> Maybe? :) What's a redirect? I can't really find that either. The main thing I found is this:
> http://stackoverflow.com/questions/7977179/how-do-i-simply-redirect-to-another-toplevel-seaside-component
>
> Cheers,
>
> Jeff
>
>
> On Fri, Mar 27, 2015 at 1:20 PM Brad <[hidden email]> wrote:
> Would a redirect work?
>
> Brad Selfridge
> 913-269-2385
>
> > On Mar 27, 2015, at 11:40 AM, J.F. Rick <[hidden email]> wrote:
> >
> > This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?
> >
> > Cheers,
> >
> > Jeff
> > _______________________________________________
> > 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

_______________________________________________
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: Alternative to call:

Sven Van Caekenberghe-2

> On 28 Mar 2015, at 00:42, J.F. Rick <[hidden email]> wrote:
>
> Right, but, if I were to do a static url, it would be much easier just to use
>     html anchor url: '/browse'
> instead of
>     html anchor callback: [ self requestContext redirectTo: '/browse' ]
> I just want my top component replaced by the call rather than the component that issues the callback.

With the redirect you will also loose your session I guess, probably not what you want.

For what you want, you need to structure your app differently, but that is up to you, there is not one solution.

Eg. a shell app with one main subcomponent, and some mechanism to communicate, like announcements. Using a top level task can also solve many problems.

> Cheers,
>
> Jeff
>
>
> On Fri, Mar 27, 2015 at 7:31 PM Sven Van Caekenberghe <[hidden email]> wrote:
> WARequestContext>>#redirectTo:
>
> As in
>
> self requestContext redirectTo: '/browse'
>
> > On 28 Mar 2015, at 00:13, J.F. Rick <[hidden email]> wrote:
> >
> > Maybe? :) What's a redirect? I can't really find that either. The main thing I found is this:
> > http://stackoverflow.com/questions/7977179/how-do-i-simply-redirect-to-another-toplevel-seaside-component
> >
> > Cheers,
> >
> > Jeff
> >
> >
> > On Fri, Mar 27, 2015 at 1:20 PM Brad <[hidden email]> wrote:
> > Would a redirect work?
> >
> > Brad Selfridge
> > 913-269-2385
> >
> > > On Mar 27, 2015, at 11:40 AM, J.F. Rick <[hidden email]> wrote:
> > >
> > > This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?
> > >
> > > Cheers,
> > >
> > > Jeff
> > > _______________________________________________
> > > 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
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Alternative to call:

Johan Brichau-2
In reply to this post by jrick
Hi Jeff,

Mind that #call: is documented in Seaside to “replace the receiving component with the argument component”. So, the receiver of #call: is equally important as its argument. 

Sending #call: to the session presenter is something you can do indeed. It’s not a ‘wrong’ way to do it (imho), but I think it's cleaner to parameterize your component with the component it should replace when using #call:.
Components are intended to be reusable and if some of the callbacks they render are intended to replace another component (e.g. toplevel), then it’s a dependency of the component. So, I would add an instance variable to your component that you assign when you instantiate the component. In your use case, you would pass the toplevel component when instantiating. Immediately, you have made your component more reusable as well, which is the core concept in Seaside ;)

cheers
Johan


On 28 Mar 2015, at 00:28, J.F. Rick <[hidden email]> wrote:

Perhaps I figured it out. I just replaced
    self call: something
with
    self session presenter call: something
It works, but it may not be the right way to do this.

Cheers,

Jeff

On Fri, Mar 27, 2015 at 7:13 PM J.F. Rick <[hidden email]> wrote:
Maybe? :) What's a redirect? I can't really find that either. The main thing I found is this:
http://stackoverflow.com/questions/7977179/how-do-i-simply-redirect-to-another-toplevel-seaside-component

Cheers,

Jeff


On Fri, Mar 27, 2015 at 1:20 PM Brad <[hidden email]> wrote:
Would a redirect work?

Brad Selfridge
913-269-2385

> On Mar 27, 2015, at 11:40 AM, J.F. Rick <[hidden email]> wrote:
>
> This is a silly novice question but I couldn't easily find the answer in the documentation. I'm trying to open up a completely different part of my application. When I do call:, it replaces the component with the new component. I want it to replace everything. What do I do?
>
> Cheers,
>
> Jeff
> _______________________________________________
> 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


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

Re: Alternative to call:

Stephan Eggermont-3
In reply to this post by jrick
On 27/03/15 17:40, J.F. Rick wrote:
> This is a silly novice question but I couldn't easily find the answer in
> the documentation. I'm trying to open up a completely different part of
> my application. When I do call:, it replaces the component with the new
> component. I want it to replace everything. What do I do?

Download a QCMagritte image from ci and take a look at QCComponent and
QCPageChoice, starting from addPage:announcement:

It assumes you have an announcer in your session class.

Stephan

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

Re: Alternative to call:

jrick
Thanks everybody for the guidance. I'm still getting used to the Seaside component model, but my competence is growing. For what I want to do (basically, a thumbnail that takes you to the profile page for that user), using the session presenter seems like the way to go.

Cheers,

Jeff

On Sat, Mar 28, 2015 at 5:49 AM Stephan Eggermont <[hidden email]> wrote:
On 27/03/15 17:40, J.F. Rick wrote:
> This is a silly novice question but I couldn't easily find the answer in
> the documentation. I'm trying to open up a completely different part of
> my application. When I do call:, it replaces the component with the new
> component. I want it to replace everything. What do I do?

Download a QCMagritte image from ci and take a look at QCComponent and
QCPageChoice, starting from addPage:announcement:

It assumes you have an announcer in your session class.

Stephan

_______________________________________________
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: Alternative to call:

Stephan Eggermont-3
On 28/03/15 16:53, J.F. Rick wrote:
> Thanks everybody for the guidance. I'm still getting used to the Seaside
> component model, but my competence is growing. For what I want to do
> (basically, a thumbnail that takes you to the profile page for that
> user), using the session presenter seems like the way to go.

I don't know any Seaside applications doing that, which suggests it
might not be the way to go. Doing what you want with pagechoice and
announcements is easy. For a complete application using that style,
take a look at StoryBoard on ci.inria.fr/pharo-contribution

https://vimeo.com/49195501

Stephan

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

Re: Alternative to call:

Philippe Marschall
In reply to this post by jrick
On Fri, Mar 27, 2015 at 5:40 PM, J.F. Rick <[hidden email]> wrote:
> This is a silly novice question but I couldn't easily find the answer in the
> documentation. I'm trying to open up a completely different part of my
> application. When I do call:, it replaces the component with the new
> component. I want it to replace everything. What do I do?

self session presenter call: myComponent

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