Ending all callbacks/calls

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

Ending all callbacks/calls

John Thornborrow
Hello,

I'm trying to add a "home" link/button to our application, which will
return the user to the page after login, whilst not leaving a trail of
calls/callbacks "hanging" in memory.

We are using several tasks for some parts of this application, so I'll
make a cut-down example.

Root>>go
  self call: TaskA

TaskA>>go
  self call: Component

Component>>renderContentOn: html
  html anchor callback: [ self session goHome ]; with: 'Home'


What I have tried so far, is subclassing the session, and task and
component with the following overrides:

Task/Component>>call: aComponentOrTask
  self session addCall: aComponentOrTask.
  ^super call: aComponentOrTask.

Task/Component>>answer: anObject.
  self session removeCall: self.
  ^super answer: anObject

Session>>addCall: aComponentOrTask
  calls add: aComponentOrTask

Session>>removeCall: aComponentOrTask
  calls remove: aComponentOrTask

Session>>goHome
  calls do: [ :each | each answer: nil ]


However, the process will only send #answer: to the first component due
to the continuations (I think.)

Does anyone know of a way to effectively reset the application state to
a specific callback?

Many thanks,
--
John Thornborrow
http://www.pinesoft.co.uk


******************************************************************************************************************************************
This email is from Pinesoft Limited. Its contents are confidential to the intended recipient(s) at the email address(es) to which it has been addressed. It may not be disclosed to or used by anyone other than the addressee(s), nor may it be copied in anyway. If received in error, please contact the sender, then delete it from your system. Although this email and attachments are believed to be free of virus, or any other defect which might affect any computer or IT system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by Pinesoft for any loss or damage arising in any way from receipt or use thereof. *******************************************************************************************************************************************


Pinesoft Limited are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Ending all callbacks/calls

Ramon Leon-5
> Hello,
>
> I'm trying to add a "home" link/button to our application,
> which will return the user to the page after login, whilst
> not leaving a trail of calls/callbacks "hanging" in memory.
>
> We are using several tasks for some parts of this
> application, so I'll make a cut-down example.
>
> Root>>go
>   self call: TaskA
>
> TaskA>>go
>   self call: Component
>
> Component>>renderContentOn: html
>   html anchor callback: [ self session goHome ]; with: 'Home'
>
>
> What I have tried so far, is subclassing the session, and
> task and component with the following overrides:
>
> Task/Component>>call: aComponentOrTask
>   self session addCall: aComponentOrTask.
>   ^super call: aComponentOrTask.
>
> Task/Component>>answer: anObject.
>   self session removeCall: self.
>   ^super answer: anObject
>
> Session>>addCall: aComponentOrTask
>   calls add: aComponentOrTask
>
> Session>>removeCall: aComponentOrTask
>   calls remove: aComponentOrTask
>
> Session>>goHome
>   calls do: [ :each | each answer: nil ]
>
>
> However, the process will only send #answer: to the first
> component due to the continuations (I think.)
>
> Does anyone know of a way to effectively reset the
> application state to a specific callback?
>
> Many thanks,
> --
> John Thornborrow
> http://www.pinesoft.co.uk

Are you aware of WAComponent>>home, it does exactly this.  Sending home to
any component removes all decorations from it.

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: Ending all callbacks/calls

John Thornborrow
That would still have issues, would it not?

How would (from my example) Component know to return to TaskA?

Many thanks,
John

Ramon Leon wrote:

>> Hello,
>>
>> I'm trying to add a "home" link/button to our application,
>> which will return the user to the page after login, whilst
>> not leaving a trail of calls/callbacks "hanging" in memory.
>>
>> We are using several tasks for some parts of this
>> application, so I'll make a cut-down example.
>>
>> Root>>go
>>   self call: TaskA
>>
>> TaskA>>go
>>   self call: Component
>>
>> Component>>renderContentOn: html
>>   html anchor callback: [ self session goHome ]; with: 'Home'
>>
>>
>> What I have tried so far, is subclassing the session, and
>> task and component with the following overrides:
>>
>> Task/Component>>call: aComponentOrTask
>>   self session addCall: aComponentOrTask.
>>   ^super call: aComponentOrTask.
>>
>> Task/Component>>answer: anObject.
>>   self session removeCall: self.
>>   ^super answer: anObject
>>
>> Session>>addCall: aComponentOrTask
>>   calls add: aComponentOrTask
>>
>> Session>>removeCall: aComponentOrTask
>>   calls remove: aComponentOrTask
>>
>> Session>>goHome
>>   calls do: [ :each | each answer: nil ]
>>
>>
>> However, the process will only send #answer: to the first
>> component due to the continuations (I think.)
>>
>> Does anyone know of a way to effectively reset the
>> application state to a specific callback?
>>
>> Many thanks,
>> --
>> John Thornborrow
>> http://www.pinesoft.co.uk
>
> Are you aware of WAComponent>>home, it does exactly this.  Sending home to
> any component removes all decorations from it.
>
> Ramon Leon
> http://onsmalltalk.com
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

--
John Thornborrow
http://www.pinesoft.co.uk


******************************************************************************************************************************************
This email is from Pinesoft Limited. Its contents are confidential to the intended recipient(s) at the email address(es) to which it has been addressed. It may not be disclosed to or used by anyone other than the addressee(s), nor may it be copied in anyway. If received in error, please contact the sender, then delete it from your system. Although this email and attachments are believed to be free of virus, or any other defect which might affect any computer or IT system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by Pinesoft for any loss or damage arising in any way from receipt or use thereof. *******************************************************************************************************************************************


Pinesoft Limited are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Ending all callbacks/calls

Ramon Leon-5
>
> That would still have issues, would it not?
>
> How would (from my example) Component know to return to TaskA?
>
> Many thanks,
> John

If you want Component to return to taskA, then you have component tell taskA
#home, taskA will then remove all its decorations.  To keep it simple,
consider the idea of a current home component available globally on the
session...

Root>>go
  | homeComponent |
  homeComponent := TaskA new.
  self session homeComponent: homeComponent.
  self call: homeComponent

TaskA>>go
  self call: Component new.

Component>>renderContentOn: html
  html anchor callback: [ self session homeComponent home ]; with: 'Home'

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: Ending all callbacks/calls

John Thornborrow
Sounds good, I'll use that.

Thanks Ramon.

John

Ramon Leon wrote:

>> That would still have issues, would it not?
>>
>> How would (from my example) Component know to return to TaskA?
>>
>> Many thanks,
>> John
>
> If you want Component to return to taskA, then you have component tell taskA
> #home, taskA will then remove all its decorations.  To keep it simple,
> consider the idea of a current home component available globally on the
> session...
>
> Root>>go
>   | homeComponent |
>   homeComponent := TaskA new.
>   self session homeComponent: homeComponent.
>   self call: homeComponent
>
> TaskA>>go
>   self call: Component new.
>
> Component>>renderContentOn: html
>   html anchor callback: [ self session homeComponent home ]; with: 'Home'
>
> Ramon Leon
> http://onsmalltalk.com
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

--
John Thornborrow
http://www.pinesoft.co.uk


******************************************************************************************************************************************
This email is from Pinesoft Limited. Its contents are confidential to the intended recipient(s) at the email address(es) to which it has been addressed. It may not be disclosed to or used by anyone other than the addressee(s), nor may it be copied in anyway. If received in error, please contact the sender, then delete it from your system. Although this email and attachments are believed to be free of virus, or any other defect which might affect any computer or IT system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by Pinesoft for any loss or damage arising in any way from receipt or use thereof. *******************************************************************************************************************************************


Pinesoft Limited are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside