Where to look to find out what...

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

Where to look to find out what...

Rick Flower
Just curious if someone can tell me where in Seaside I can look to get a
list of all of the available
"html" messages I can use when rendering with Seaside.. In looking at
the online docs for Seaside,
it seems more like a subset of whats available instead of having
everything there..  Even better would
be some good examples of each possible item and typical usage.  I've
been poking around in the
Seaside classes, but am not sure what I should be looking for exactly..

Can someone point me in the right direction?

This came about when I was looking for the proper way to generate the
following HTML:

<p style="font-size: x-large; text-align:center;"> ... </p>

I think I should be doing something like :

html paragraph with: [ ... ]

but am unsure about how to set specific css styles for this sort of
case, either using the new or old Canvas API

Thanks!

-- Rick

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

Re: Where to look to find out what...

Julian Fitzell
For the old API, just browse the protocol of WAHtmlRenderer.

For the Canvas API, you need to do a little work since the methods are
spread out across a bunch of classes.  But most of them are on
WAHtmlCanvas.  Then look at the rest of the canvas class hierarchy and
the several tag classes in the Seaside-Canvas and Seaside-Canvas-Tags
system categories.

Julian

Rick Flower wrote:

> Just curious if someone can tell me where in Seaside I can look to get a
> list of all of the available
> "html" messages I can use when rendering with Seaside.. In looking at
> the online docs for Seaside,
> it seems more like a subset of whats available instead of having
> everything there..  Even better would
> be some good examples of each possible item and typical usage.  I've
> been poking around in the
> Seaside classes, but am not sure what I should be looking for exactly..
> Can someone point me in the right direction?
>
> This came about when I was looking for the proper way to generate the
> following HTML:
>
> <p style="font-size: x-large; text-align:center;"> ... </p>
>
> I think I should be doing something like :
>
> html paragraph with: [ ... ]
>
> but am unsure about how to set specific css styles for this sort of
> case, either using the new or old Canvas API
>
> Thanks!
>
> -- Rick
>
> _______________________________________________
> 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: Where to look to find out what...

Rick Flower
Julian Fitzell wrote:
> For the old API, just browse the protocol of WAHtmlRenderer.
>
> For the Canvas API, you need to do a little work since the methods are
> spread out across a bunch of classes.  But most of them are on
> WAHtmlCanvas.  Then look at the rest of the canvas class hierarchy and
> the several tag classes in the Seaside-Canvas and Seaside-Canvas-Tags
> system categories.
>
Do I need to do anything if I want to use one over the other?  In my
case I believe I'm using the default (whatever that is).. If it helps,
I'm using Seaside 2.5b8..

-- Rick

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

Re: Where to look to find out what...

Julian Fitzell
Whatever your component returns when sent #rendererClass will be used as
the renderer for that component.

WAPresenter (a superclass of WAComponent) implements it like this:

rendererClass
        ^ WAHtmlRenderer

So your components will all use the old rendering API unless you
reimplement that method to return WAHtmlCanvas instead.  If you want to
do this, it's probably best to make a component subclass for your
project and then subclass that for all your components.  This is good
practice anyway as there always seems to be behaviour you want to share
across all your components anyway.

Julian

Rick Flower wrote:

> Julian Fitzell wrote:
>
>> For the old API, just browse the protocol of WAHtmlRenderer.
>>
>> For the Canvas API, you need to do a little work since the methods are
>> spread out across a bunch of classes.  But most of them are on
>> WAHtmlCanvas.  Then look at the rest of the canvas class hierarchy and
>> the several tag classes in the Seaside-Canvas and Seaside-Canvas-Tags
>> system categories.
>>
> Do I need to do anything if I want to use one over the other?  In my
> case I believe I'm using the default (whatever that is).. If it helps,
> I'm using Seaside 2.5b8..
>
> -- Rick
>
> _______________________________________________
> 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: Where to look to find out what...

wilkesj
In reply to this post by Rick Flower
On 3/2/06, Rick Flower <[hidden email]> wrote:

> Julian Fitzell wrote:
> > For the old API, just browse the protocol of WAHtmlRenderer.
> >
> > For the Canvas API, you need to do a little work since the methods are
> > spread out across a bunch of classes.  But most of them are on
> > WAHtmlCanvas.  Then look at the rest of the canvas class hierarchy and
> > the several tag classes in the Seaside-Canvas and Seaside-Canvas-Tags
> > system categories.
> >
> Do I need to do anything if I want to use one over the other?  In my
> case I believe I'm using the default (whatever that is).. If it helps,
> I'm using Seaside 2.5b8..

I would start working with the 2.6a3 branch.  I'm not sure if 2.5 has
the Canvas classes.  They are definitely the way things are headed and
much nicer to use.  Here is a link to my response to a similar
question.

http://lists.squeakfoundation.org/pipermail/seaside/2006-January/006600.html

One little trick with the Canvas / Brush classes, you should call
with: or text: last when cascade several messages i.e.

html anchor
    callback: [self doSomething];
    id: 'anchorId';
    text: 'Click Me!'.

html div id: 'myDiv'; with:
   [html text: 'hello']

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

Re: Where to look to find out what...

Rick Flower
In reply to this post by Julian Fitzell
Julian Fitzell wrote:

> Whatever your component returns when sent #rendererClass will be used
> as the renderer for that component.
>
> WAPresenter (a superclass of WAComponent) implements it like this:
>
> rendererClass
>     ^ WAHtmlRenderer
>
> So your components will all use the old rendering API unless you
> reimplement that method to return WAHtmlCanvas instead.  If you want
> to do this, it's probably best to make a component subclass for your
> project and then subclass that for all your components.  This is good
> practice anyway as there always seems to be behaviour you want to
> share across all your components anyway.
>
Thanks Julian -- my next question is whether or not the WAHtmlCanvas is
sufficiently stable at this point to use it (e.g. is the design going to
change enough to break things as I proceed down my path and perhaps
upgrade Seaside occasionally as I go).. If there is still working being
done that may break things that use it, I'll probably continue using
what I've got now (WAHtmlRenderer).. Thanks!

-- Rick


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

Re: Where to look to find out what...

Julian Fitzell
There's always work being done, but you should be safe to use it.  There
are certainly plenty of people who are and the only reason it isn't the
default is really to avoid breaking backwards compatibility.

You may have to make small changes if you're updating seaside but they
shouldn't be too major...

Julian

Rick Flower wrote:

> Julian Fitzell wrote:
>
>> Whatever your component returns when sent #rendererClass will be used
>> as the renderer for that component.
>>
>> WAPresenter (a superclass of WAComponent) implements it like this:
>>
>> rendererClass
>>     ^ WAHtmlRenderer
>>
>> So your components will all use the old rendering API unless you
>> reimplement that method to return WAHtmlCanvas instead.  If you want
>> to do this, it's probably best to make a component subclass for your
>> project and then subclass that for all your components.  This is good
>> practice anyway as there always seems to be behaviour you want to
>> share across all your components anyway.
>>
> Thanks Julian -- my next question is whether or not the WAHtmlCanvas is
> sufficiently stable at this point to use it (e.g. is the design going to
> change enough to break things as I proceed down my path and perhaps
> upgrade Seaside occasionally as I go).. If there is still working being
> done that may break things that use it, I'll probably continue using
> what I've got now (WAHtmlRenderer).. Thanks!
>
> -- Rick
>
>
> _______________________________________________
> 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: Where to look to find out what...

Rick Flower
In reply to this post by Julian Fitzell
Julian Fitzell wrote:
Whatever your component returns when sent #rendererClass will be used as the renderer for that component.

WAPresenter (a superclass of WAComponent) implements it like this:

rendererClass
    ^ WAHtmlRenderer
Julian et-al,

I put the following in my main object class for my application just to try things out:

MyWebApp>>rendererClass
    "Set to either WAHtmlRenderer for old Seaside rendering or WAHtmlCanvas for new style"
    ^ WAHtmlCanvas

MyWebApp>>renderContentOn: html
    html text: 'testing'


when I re-load my page, I get the following output :

Message not understood: #context:callbacks:

Seaside.WAHtmlCanvas class(Object)>>doesNotUnderstand:

Now, I will admit that I've upgraded from Seaside 2.5b8 to 2.6a2 (I couldn't find a3 on the Cincom server).. Not sure
if that matters..

Anyway, an interesting item is (in my opinion) is that the top object on the stack indicates that we're using WAHtmlCanvas,
but a few items down the stack has items that are showing things like (using WAHtmlRenderer):

optimized [] in Seaside.WAComponent>>renderOn:
self BlockClosure [] in Seaside.WAComponent>>renderOn:
temps
each a MyWebApp
aRenderer a Seaside.WAHtmlRenderer
inst vars
method CompiledBlock [] in Seaside.WAComponent>>renderOn:
outerContext nil
copiedValues a Seaside.WAHtmlRenderer

Is there something I've missed for the switchover?


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

Re: Where to look to find out what...

Rick Flower
Rick Flower wrote:
> Julian Fitzell wrote:
>> Whatever your component returns when sent #rendererClass will be used
>> as the renderer for that component.
>>
>> WAPresenter (a superclass of WAComponent) implements it like this:
>>
>> rendererClass
>>     ^ WAHtmlRenderer
Ok.. Problem solved.. If I change my MyWebApp>>rendererClass definition
to look like the one below,
the problem disappears and everything works..

rendererClass
    "Set to either WAHtmlRenderer for old Seaside rendering or
WARenderCanvas for new style"
    ^ WARenderCanvas

-- Rick

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

Re: Where to look to find out what...

Julian Fitzell
Oops!  Sorry! :)

Julian

Rick Flower wrote:

> Rick Flower wrote:
>
>> Julian Fitzell wrote:
>>
>>> Whatever your component returns when sent #rendererClass will be used
>>> as the renderer for that component.
>>>
>>> WAPresenter (a superclass of WAComponent) implements it like this:
>>>
>>> rendererClass
>>>     ^ WAHtmlRenderer
>
> Ok.. Problem solved.. If I change my MyWebApp>>rendererClass definition
> to look like the one below,
> the problem disappears and everything works..
>
> rendererClass
>    "Set to either WAHtmlRenderer for old Seaside rendering or
> WARenderCanvas for new style"
>    ^ WARenderCanvas
>
> -- Rick
>
> _______________________________________________
> 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