initialRequest: / updateRoot: / updateUrl:

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

initialRequest: / updateRoot: / updateUrl:

fstephany
Hi list,

I probably forget something stupid but I have some trouble with
initialRequest:/updateRoot:/updateUrl:

WAComponent
   subclass: #WPRootComponent
   instanceVariableNames: 'visibleComponent'

WPRootComponent>>children
   ^Array with: self visibleComponent.

WPRootComponent>>renderContentOn: html
   html render: self visibleComponent.

WPRootComponent>>visibleComponent
   visibleComponent isNil ifTrue: [ self resetVisibleComponent ].
   ^visibleComponent.

visibleComponent is an instance of sublass of a subclass of WAComponent.

WPAVisibleComponent>>updateUrl: anUrl
   self halt.


initialRequest:, updateRoot: and updateUrl: are never called on
visibleComponent (halt never occurs).

Are there common mistakes that introduce this behaviour ?

Cheers,
Francois

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

Re: initialRequest: / updateRoot: / updateUrl:

sebastianconcept@gmail.co
the lazy init is ok?

is #resetVisibleComponent doing something like this:


        ^ visibleComponent := VisibleComponent new

??




On May 19, 2011, at 3:31 PM, Francois Stephany wrote:

> Hi list,
>
> I probably forget something stupid but I have some trouble with initialRequest:/updateRoot:/updateUrl:
>
> WAComponent
>  subclass: #WPRootComponent
>  instanceVariableNames: 'visibleComponent'
>
> WPRootComponent>>children
>  ^Array with: self visibleComponent.
>
> WPRootComponent>>renderContentOn: html
>  html render: self visibleComponent.
>
> WPRootComponent>>visibleComponent
>  visibleComponent isNil ifTrue: [ self resetVisibleComponent ].
>  ^visibleComponent.
>
> visibleComponent is an instance of sublass of a subclass of WAComponent.
>
> WPAVisibleComponent>>updateUrl: anUrl
>  self halt.
>
>
> initialRequest:, updateRoot: and updateUrl: are never called on visibleComponent (halt never occurs).
>
> Are there common mistakes that introduce this behaviour ?
>
> Cheers,
> Francois
>
> _______________________________________________
> 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: initialRequest: / updateRoot: / updateUrl:

Johan Brichau-2
In reply to this post by fstephany

On 19 May 2011, at 20:31, Francois Stephany wrote:

> Are there common mistakes that introduce this behaviour ?

Hm... since your #children method seems correct, I'm guessing:

Did you override #initialize / #initialRequest / #updateUrl: somewhere without doing a super call?

I also think it's better to refrain from lazy initialization when using Seaside, since it's a source of bugs like this.
Although I think it's not an issue in this case because the #children method calls it.

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

Re: initialRequest: / updateRoot: / updateUrl:

fstephany
In reply to this post by sebastianconcept@gmail.co

> the lazy init is ok?
>
> is #resetVisibleComponent doing something like this:
>
>
> ^ visibleComponent := VisibleComponent new
>
> ??

Yep, I have tried:

resetVisibleComponent
   self visibleComponent: WPStudioComponent new.

resetVisibleComponent
   visibleComponent := WPStudioComponent new.

resetVisibleComponent
   ^visibleComponent := WPStudioComponent new.


Everything else seems to work (rendering, callbacks), I'm certainly
doing something stupid somewhere but can't find what.



--
[hidden email]
http://www.agilitic.com
+32 (0)484/580.322

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

Re: initialRequest: / updateRoot: / updateUrl:

fstephany
In reply to this post by Johan Brichau-2

> Did you override #initialize / #initialRequest / #updateUrl: somewhere without doing a super call?

I've rechecked and they all seem to be ok.

> I also think it's better to refrain from lazy initialization when using Seaside, since it's a source of bugs like this.
> Although I think it's not an issue in this case because the #children method calls it.

I've removed the lazy initialization and setup my visibleComponent in
#initialize but still have the problem.


Mmmmm...

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

Re: initialRequest: / updateRoot: / updateUrl:

Johan Brichau-2
But wait...

... is updateUrl: supposed to be invoked recursively on the subcomponents?
I wonder if that makes sense because you would have to know in which order the traversal happens to meaningfully update the url in each subcomponent. No?

Can you try to implement updateRoot: on your subcomponent? Is that one called? (this one propagates for sure to the children)

On 20 May 2011, at 09:32, Francois Stephany wrote:

>
>> Did you override #initialize / #initialRequest / #updateUrl: somewhere without doing a super call?
>
> I've rechecked and they all seem to be ok.
>
>> I also think it's better to refrain from lazy initialization when using Seaside, since it's a source of bugs like this.
>> Although I think it's not an issue in this case because the #children method calls it.
>
> I've removed the lazy initialization and setup my visibleComponent in #initialize but still have the problem.
>
>
> Mmmmm...
>
> _______________________________________________
> 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: initialRequest: / updateRoot: / updateUrl:

fstephany
In reply to this post by Johan Brichau-2

> Hm... since your #children method seems correct:

Haha got it.
One of my children method was:

children
   ^Array
      with: self subComponent;
      with: self loginComponent.


Obviously the cascade is wrong:

children
   ^Array
      with: self subComponent
      with: self loginComponent.


Sorry for the noise !


Francois

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