Dumb newbie problem with repeating a call/answer

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

Dumb newbie problem with repeating a call/answer

Richard Huxton
I've tried to simplify this as much as possible. A call/answer works
first time I use it in a session, but not the second.

New class (will eventually be a form)...
WAComponent subclass: #ArchDummyEditor

ArchDummyEditor >> renderContentOn: html
   html anchorWithAction: [ self answer: 'one' ] text: 'link one'.
   html anchorWithAction: [ self answer: 'two' ] text: 'link two'.

Then hack WATaskTest adding two inst vars (dummy foo)...

WATaskTest >> initialize
   dummy := ArchDummyEditor new.

WATaskTest >> foo: f
   foo := f.

WATaskTest >> renderContentOn: html
   self foo: (self call: dummy)
   html text: 'foo = ',foo; break

Go into the seaside test area, select the task test, click "link one" -
it works, I get "foo = one" on-screen.

Select the task test again, click "link two" - Internal Server Error...
MessageNotUnderstood: UndefinedObject>>reset. No "debug" link on the screen.

I've added "Transcript show:"s and both #foo and #renderContentOn are
completing. I can't find what is being sent "reset" - the message finder
lists hundreds of classes implementing it but not mine or Seaside's
(afaict).

Anyone got a clue-stick handy?
--
   Richard Huxton
   Archonet Ltd
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dumb newbie problem with repeating a call/answer

Dmitry Dorofeev
Basically never use call while you are rendering.
I.e. inside renderContentOn:
Use call as 'action' for some link or form processing only.

-Dmitry.

Richard Huxton wrote:

> I've tried to simplify this as much as possible. A call/answer works
> first time I use it in a session, but not the second.
>
> New class (will eventually be a form)...
> WAComponent subclass: #ArchDummyEditor
>
> ArchDummyEditor >> renderContentOn: html
>   html anchorWithAction: [ self answer: 'one' ] text: 'link one'.
>   html anchorWithAction: [ self answer: 'two' ] text: 'link two'.
>
> Then hack WATaskTest adding two inst vars (dummy foo)...
>
> WATaskTest >> initialize
>   dummy := ArchDummyEditor new.
>
> WATaskTest >> foo: f
>   foo := f.
>
> WATaskTest >> renderContentOn: html
>   self foo: (self call: dummy)
>   html text: 'foo = ',foo; break
>
> Go into the seaside test area, select the task test, click "link one" -
> it works, I get "foo = one" on-screen.
>
> Select the task test again, click "link two" - Internal Server Error...
> MessageNotUnderstood: UndefinedObject>>reset. No "debug" link on the
> screen.
>
> I've added "Transcript show:"s and both #foo and #renderContentOn are
> completing. I can't find what is being sent "reset" - the message finder
> lists hundreds of classes implementing it but not mine or Seaside's
> (afaict).
>
> Anyone got a clue-stick handy?
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dumb newbie problem with repeating a call/answer

Richard Huxton
Dmitry Dorofeev wrote:
> Basically never use call while you are rendering.
> I.e. inside renderContentOn:
> Use call as 'action' for some link or form processing only.

Thanks Dmitry - that does the trick. Quick answer!


For the record, if I further change WATaskTest...

renderContentOn: html
        html text: 'foo = ', (foo asString); break.
        html anchorWithAction: [self setfoo] text: 'set foo'; break.

setfoo
   Transcript show: 'setfoo...'; cr.
   self foo: (self call: dummy).

this works fine.

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

Re: Dumb newbie problem with repeating a call/answer

Dmitry Dorofeev
It works becouse your call is actually performed inside a callback/action
sequence which is how it supposed to be.

Richard Huxton wrote:

> Dmitry Dorofeev wrote:
>
>> Basically never use call while you are rendering.
>> I.e. inside renderContentOn:
>> Use call as 'action' for some link or form processing only.
>
>
> Thanks Dmitry - that does the trick. Quick answer!
>
>
> For the record, if I further change WATaskTest...
>
> renderContentOn: html
>     html text: 'foo = ', (foo asString); break.
>     html anchorWithAction: [self setfoo] text: 'set foo'; break.
>
> setfoo
>   Transcript show: 'setfoo...'; cr.
>   self foo: (self call: dummy).
>
> this works fine.
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Dumb newbie problem with repeating a call/answer

Ramon Leon
In reply to this post by Richard Huxton
> Thanks Dmitry - that does the trick. Quick answer!
>
>
> For the record, if I further change WATaskTest...
>
> renderContentOn: html
> html text: 'foo = ', (foo asString); break.
> html anchorWithAction: [self setfoo] text: 'set foo'; break.
>
> setfoo
>    Transcript show: 'setfoo...'; cr.
>    self foo: (self call: dummy).
>
> this works fine.
>

For all you new guys, you should really start using the Canvas API right
off the bat, it's much easier to use and much more consistent than the
old HtmlRendering API.

The above would be something like...

 renderContentOn: html
  html text: 'foo = ', (foo asString); break.
  (html anchor)
          callback: [self setfoo];
          text: 'set foo'.
        html break.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dumb newbie problem with repeating a call/answer

Brad Fuller
Ramon Leon wrote:

>> Thanks Dmitry - that does the trick. Quick answer!
>>
>>
>> For the record, if I further change WATaskTest...
>>
>> renderContentOn: html
>> html text: 'foo = ', (foo asString); break.
>> html anchorWithAction: [self setfoo] text: 'set foo'; break.
>>
>> setfoo
>>    Transcript show: 'setfoo...'; cr.
>>    self foo: (self call: dummy).
>>
>> this works fine.
>>
>>    
>
> For all you new guys, you should really start using the Canvas API right
> off the bat, it's much easier to use and much more consistent than the
> old HtmlRendering API.
>
> The above would be something like...
>
>  renderContentOn: html
>   html text: 'foo = ', (foo asString); break.
>   (html anchor)
>           callback: [self setfoo];
>           text: 'set foo'.
> html break.
>  
that's cool.. I'm now creating my first website... and I've been using
HtmlRendering.
Any pointers on docs I should read first for learning the canvas API?
It seems similar.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Dumb newbie problem with repeating a call/answer

Ramon Leon
In reply to this post by Richard Huxton
> that's cool.. I'm now creating my first website... and I've
> been using HtmlRendering.
> Any pointers on docs I should read first for learning the canvas API?
> It seems similar.

Canvas is much better, it's just like html.

Name a tag

(html anchor)

then set properties on it

(html anchor)
  id: 'test';
  onClick: 'alert("hey")';
  callback:[];
  liveCallback:[];
  text: 'bla'.

this pattern applies to all tags

(html div)
  id: 'cool';
  cssId: 'coolDiv';
  with:[].

Use with:[] as the last message to a tab, with:[] is what causes it to
render, and with:[] is the container, put other tags inside it.  Now you
don't have to memorize a bunch of weird methods like anchorWithAction or
whatever, just pop open a browser on the tags themselves, to see what
properties you can set on them.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dumb newbie problem with repeating a call/answer

Brad Fuller
Ramon Leon wrote:

>> that's cool.. I'm now creating my first website... and I've
>> been using HtmlRendering.
>> Any pointers on docs I should read first for learning the canvas API?
>> It seems similar.
>>    
>
> Canvas is much better, it's just like html.
>
> Name a tag
>
> (html anchor)
>
> then set properties on it
>
> (html anchor)
>   id: 'test';
>   onClick: 'alert("hey")';
>   callback:[];
>   liveCallback:[];
>   text: 'bla'.
>
> this pattern applies to all tags
>
> (html div)
>   id: 'cool';
>   cssId: 'coolDiv';
>   with:[].
>
> Use with:[] as the last message to a tab, with:[] is what causes it to
> render, and with:[] is the container, put other tags inside it.  Now you
> don't have to memorize a bunch of weird methods like anchorWithAction or
> whatever, just pop open a browser on the tags themselves, to see what
> properties you can set on them
>  
so, one could have a, say, a HOME button that would be a method?
don't know how to make it go back "Home", but:

----
homeButton

(html anchor)
  id: 'homeButton';
  onClick: [];
  callback:[];
  liveCallback:[];
  text: 'Home'.


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

RE: Dumb newbie problem with repeating a call/answer

Ramon Leon
In reply to this post by Richard Huxton
> so, one could have a, say, a HOME button that would be a method?
> don't know how to make it go back "Home", but:
>
> ----
> homeButton
>
> (html anchor)
>   id: 'homeButton';
>   onClick: [];
>   callback:[];
>   liveCallback:[];
>   text: 'Home'.

Don't set props you don't need, maybe I wasn't clear, use only what you
want, ie..

 (html anchor)
   callback:[self goHome];
   text: 'Home'.

And you'd write goHome to do whatever you want.  Or a button like...

 (html submitButton)
   callback:[self save];
   text: 'Save'.

Or...

 (html submitButton)
   on: #save of: self;
   text: 'Save'.

on:of: is a common thing when doing a callback on a method of an object,
handy shortcut.  Maybe you want to style this button so you give it an
id...

 (html submitButton)
   on: #save of: self;
   id: 'SaveButton';
   text: 'Save'.

Or maybe a class...

 (html submitButton)
   on: #save of: self;
   class: 'Button';
   text: 'Save'.

The whole point of the canvas api is to allow you to set any combination
of props you want on a tag by using cascades instead of specialized
methods.  The old api suffered from a combinatorial explosion of special
methods, the new one can't.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dumb newbie problem with repeating a call/answer

Nevin Pratt
In reply to this post by Ramon Leon

>For all you new guys, you should really start using the Canvas API right
>off the bat, it's much easier to use and much more consistent than the
>old HtmlRendering API.
>
>The above would be something like...
>
> renderContentOn: html
> html text: 'foo = ', (foo asString); break.
> (html anchor)
>          callback: [self setfoo];
>          text: 'set foo'.
> html break.
>  
>

The existance of an integrated image downloadable from www.seaside.st
would certainly encourage use of the Canvas API.

Currently, the latest integrated image is based on Seaside 2.5 (eg, the
old rendering API).  That could naturally lead one to suspect that 2.6
(eg, the new canvas API) is not yet ready for prime time.

How about it, Avi?

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

Re: Dumb newbie problem with repeating a call/answer

Avi  Bryant

On Feb 22, 2006, at 3:02 PM, Nevin Pratt wrote:
>
> The existance of an integrated image downloadable from  
> www.seaside.st would certainly encourage use of the Canvas API.
>
> Currently, the latest integrated image is based on Seaside 2.5 (eg,  
> the old rendering API).  That could naturally lead one to suspect  
> that 2.6 (eg, the new canvas API) is not yet ready for prime time.
>
> How about it, Avi?

Yup, on my list.  I'm stupidly busy right now (so forgive my general  
lack of response on this last, though it seems to be thriving without  
me :), but I've been meaning to update that image for some time.  If  
anyone beats me to it that's great, of course.

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

Re: Dumb newbie problem with repeating a call/answer

Brad Fuller
Avi Bryant wrote:

>
> On Feb 22, 2006, at 3:02 PM, Nevin Pratt wrote:
>>
>> The existance of an integrated image downloadable from www.seaside.st
>> would certainly encourage use of the Canvas API.
>>
>> Currently, the latest integrated image is based on Seaside 2.5 (eg,
>> the old rendering API).  That could naturally lead one to suspect
>> that 2.6 (eg, the new canvas API) is not yet ready for prime time.
>>
>> How about it, Avi?
>
> Yup, on my list.  I'm stupidly busy right now (so forgive my general
> lack of response on this last, though it seems to be thriving without
> me :), but I've been meaning to update that image for some time.  If
> anyone beats me to it that's great, of course.
Hmm.. that begs the question: should we be running squeak 3.7 and not
3.8 for the most stable Seaside?

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

Re: Dumb newbie problem with repeating a call/answer

Avi  Bryant

On Feb 22, 2006, at 3:23 PM, Brad Fuller wrote:
>
> Hmm.. that begs the question: should we be running squeak 3.7 and not
> 3.8 for the most stable Seaside?

Well, I do use 3.7 myself these days, and the image I put up will  
probably be 3.7 based, but of course if you want to take advantage of  
WideString you need to use 3.8.

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

Re: Dumb newbie problem with repeating a call/answer

Lukas Renggli
> > Hmm.. that begs the question: should we be running squeak 3.7 and not
> > 3.8 for the most stable Seaside?
>
> Well, I do use 3.7 myself these days, and the image I put up will
> probably be 3.7 based, but of course if you want to take advantage of
> WideString you need to use 3.8.

I am using 3.8 and the latest version of Seaside for most of my work
and I never had problems. I would say that Squeak 3.8 + Seaside 2.6 is
stable as well ;-)

Lukas

--
Lukas Renggli
http://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: Dumb newbie problem with repeating a call/answer

Ramon Leon
In reply to this post by Richard Huxton
> I am using 3.8 and the latest version of Seaside for most of
> my work and I never had problems. I would say that Squeak 3.8
> + Seaside 2.6 is stable as well ;-)
>
> Lukas

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

Re: Dumb newbie problem with repeating a call/answer

Nevin Pratt
In reply to this post by Avi Bryant
Avi Bryant wrote:

>
> On Feb 22, 2006, at 3:23 PM, Brad Fuller wrote:
>
>>
>> Hmm.. that begs the question: should we be running squeak 3.7 and not
>> 3.8 for the most stable Seaside?
>
>
> Well, I do use 3.7 myself these days, and the image I put up will  
> probably be 3.7 based, but of course if you want to take advantage of  
> WideString you need to use 3.8.
>
> Avi


OK, I'll byte.  Why 3.7?  What's wrong with 3.8?

FWIW, I'm still using 3.5.

Nevin

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

Re: Dumb newbie problem with repeating a call/answer

Damien Cassou-3
In reply to this post by Ramon Leon
>  (html submitButton)
>    on: #save of: self;
>    text: 'Save'.

You don't need even #test:

html submitButton
    on: #save of: self.

--
Damien Cassou

CSS3 :  "On passe au  HSL, plus intuitif  et moins orienté CRT  que le
RGB. Il y a du HSLA". Et en plus, ça veut dire quelque chose (au moins
pour l'auteur) !
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Dumb newbie problem with repeating a call/answer

Damien Cassou-3
In reply to this post by Brad Fuller
> Any pointers on docs I should read first for learning the canvas API?
> It seems similar.

http://lists.squeakfoundation.org/pipermail/seaside/2005-June/005260.html

--
Damien Cassou

CSS3 :  "On passe au  HSL, plus intuitif  et moins orienté CRT  que le
RGB. Il y a du HSLA". Et en plus, ça veut dire quelque chose (au moins
pour l'auteur) !
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside