Problem with announcements in Seaside when using Pharo 1.3

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

Problem with announcements in Seaside when using Pharo 1.3

Andrei Chis
Hi all,


In have a simple case: in an ajax callback I trigger an announcement and in the callback associated with the announcement I try to render a Date object. When I do this I get a WARequestContextNotFound exception. 

To be more exact I have in a component this function to render the callback link:

renderAnnouncementUpdate: html
  html anchor
    onClick: (html jQuery ajax script: [ :s |
script := s.
model announce: SGLLinkClickedAnnouncement new ]);
      with: 'Update Announcements'

The model is initialized when I create the component in:
initialize
super initialize.
model := SGLVerySimplePresentation new.
model on: SGLLinkClickedAnnouncement do: [:ann|
self onClick: ann]. 

When the announcement is called it will trigger the onclick: method which will do the rendering:
onClick: ann
self addScripts: script
addScripts: s
s << (s jQuery: #date1)
             html: [ :r | r render: Date today ].
      s << (s jQuery: #time1)
             html: [ :r | r render: Time now ]

However the html: method trigers an WARequestContextNotFound exception.

I'v tried this on Pharo 1.3 (running on CogVM) with the latest version of Seaside.

The application can be found in the Moose Playground project from http://www.squeaksource.com in the package SGL-Seaside-Problem. Atfer you install the package and
start a web server you have to execute "SGLTestComponentMin registerAsApplication: 'SGLTestComponentMin'." to register the application.

Am I missing something?

Cheers,
Andrei


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

Re: Problem with announcements in Seaside when using Pharo 1.3

Lukas Renggli
Not sure why the request context is suddenly gone in your code.

It could be that this has something to do with the announcements, the
implementation changed drastically in Pharo 1.3. I had to revert the
announcements to the original implementation in OB to make them work.

Do you properly receive the request context before doing the
announcement, just to rule out any problems in Seaside? Seaside has
not really been tested on Pharo 1.3 yet, our builds are all based on
stable Pharo 1.2.1.

Lukas

On 17 July 2011 18:53, Andrei Vasile Chis <[hidden email]> wrote:

> Hi all,
>
> In have a simple case: in an ajax callback I trigger an announcement and in
> the callback associated with the announcement I try to render a Date object.
> When I do this I get a WARequestContextNotFound exception.
> To be more exact I have in a component this function to render the callback
> link:
> renderAnnouncementUpdate: html
>   html anchor
>     onClick: (html jQuery ajax script: [ :s |
> script := s.
> model announce: SGLLinkClickedAnnouncement new ]);
>       with: 'Update Announcements'
> The model is initialized when I create the component in:
> initialize
> super initialize.
> model := SGLVerySimplePresentation new.
> model on: SGLLinkClickedAnnouncement do: [:ann|
> self onClick: ann].
> When the announcement is called it will trigger the onclick: method which
> will do the rendering:
> onClick: ann
> self addScripts: script
> addScripts: s
> s << (s jQuery: #date1)
>              html: [ :r | r render: Date today ].
>       s << (s jQuery: #time1)
>              html: [ :r | r render: Time now ]
> However the html: method trigers an WARequestContextNotFound exception.
> I'v tried this on Pharo 1.3 (running on CogVM) with the latest version of
> Seaside.
> The application can be found in the Moose Playground project from
> http://www.squeaksource.com in the package SGL-Seaside-Problem. Atfer you
> install the package and
> start a web server you have to execute "SGLTestComponentMin
> registerAsApplication: 'SGLTestComponentMin'." to register the application.
> Am I missing something?
> Cheers,
> Andrei
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>



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

Re: Problem with announcements in Seaside when using Pharo 1.3

Philippe Marschall
2011/7/17 Lukas Renggli <[hidden email]>:

> Not sure why the request context is suddenly gone in your code.
>
> It could be that this has something to do with the announcements, the
> implementation changed drastically in Pharo 1.3. I had to revert the
> announcements to the original implementation in OB to make them work.
>
> Do you properly receive the request context before doing the
> announcement, just to rule out any problems in Seaside? Seaside has
> not really been tested on Pharo 1.3 yet, our builds are all based on
> stable Pharo 1.2.1.

I've been using Pharo 1.3 for some time now and it seem to work so far.

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: Problem with announcements in Seaside when using Pharo 1.3

Tudor Girba-2
The issue described by Andrei seems to happen only in the context of an announcement.

The on:fork: fixes proposed by Igor and Stef plus overriding DynamicVariable>>alwaysResuming, seem to solve the problem.

Btw, how can we get the new implementation of on:fork:?

It would be cool to get someone else to test them.

Cheers,
Doru


On 17 Jul 2011, at 21:06, Philippe Marschall wrote:

> 2011/7/17 Lukas Renggli <[hidden email]>:
>> Not sure why the request context is suddenly gone in your code.
>>
>> It could be that this has something to do with the announcements, the
>> implementation changed drastically in Pharo 1.3. I had to revert the
>> announcements to the original implementation in OB to make them work.
>>
>> Do you properly receive the request context before doing the
>> announcement, just to rule out any problems in Seaside? Seaside has
>> not really been tested on Pharo 1.3 yet, our builds are all based on
>> stable Pharo 1.2.1.
>
> I've been using Pharo 1.3 for some time now and it seem to work so far.
>
> Cheers
> Philippe
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

--
www.tudorgirba.com

"If you interrupt the barber while he is cutting your hair,
you will end up with a messy haircut."

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

Re: Problem with announcements in Seaside when using Pharo 1.3

Lukas Renggli
> The on:fork: fixes proposed by Igor and Stef plus overriding DynamicVariable>>alwaysResuming, seem to solve the problem.

No, that doesn't solve the problem. People throw exceptions (not just
notifications) and they expect that their handlers are able to catch
them.

Furthermore, it is an obscure counterpart of #isResumable (i don't
understand the difference).

Lukas

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

Re: Problem with announcements in Seaside when using Pharo 1.3

Philippe Marschall
In reply to this post by Tudor Girba-2
2011/7/17 Tudor Girba <[hidden email]>:
> The issue described by Andrei seems to happen only in the context of an announcement.
>
> The on:fork: fixes proposed by Igor and Stef plus overriding DynamicVariable>>alwaysResuming, seem to solve the problem.
>
> Btw, how can we get the new implementation of on:fork:?

Every time you try to be clever you introduce new problems, so don't try
to be clever.

The only way to fix broken code is to fix broken code, not by adding
additional clever hacks.

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: [Pharo-project] [Seaside] Problem with announcements in Seaside when using Pharo 1.3

Damien Cassou
In reply to this post by Lukas Renggli
On Mon, Jul 18, 2011 at 9:01 AM, Philippe Marschall
<[hidden email]> wrote:
> The only way to fix broken code is to fix broken code, not by adding
> additional hacks.

I do appreciate all the efforts of the development team. Please go on,
try new ideas, and if they don't work you will still have time to
revert them.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside