Hi all
I started to really program with seaside and I bumped in the following problems: no class comments, limited examples...and I was in the train. And I did all the mistakes one after the other (no children, direct invocation of renderContentOn:...). So instead of complaining I would like to know what we can do to improve the situation. So here is a list of questions and simple cs to improve simply what can be done.
- How can I get the WAAllTests running? I added a initialize method so that we can get AllTests up and running in the browser.
I guess like that so may be this should be in the distribution...
- What is the process to add comments to seaside? Should we send something to this list and avi will review it and include it?
Even if this comment is copied an paste from the web site at least if it would have been there I would not make all my mistakes.
- There are a lot of widgets but I could not find example (may be this is in WAAllTests)? Is there a simple process to have examples of the widgets.
- Is there an FAQ? Is there a Wiki that we can add some examples?
- Is there a process to collect and document other widgets?
- Is there a database of widgets?
- I saw a demoes of seaside written in seaside and some other pieces of code. How can I find all the projects available developed in seaside that I can use as examples? Would he make sense to have www.seasideSource.com (a SqueakSource containing only seaside examples?)
Now some more technical questions:
------------------------------------------------------------------------ ------------------ What is the difference between a task and a component?
------------------------------------------------------------------------ ------------------
What is the difference between renderOn: and renderContentOn:?
I tried to explain it here.
------------------------------------------------------------------------ ------------------
In WAStoreFillCart>>displayItems: aCollection | list | aCollection size = 1 ifTrue: [^ self displayItem: aCollection first]. list := WABatchSelection items: aCollection link: #title text: #subtitle. [self displayItem: (main call: list)] repeat
I do not understand the repeat.
------------------------------------------------------------------------ ------------------ I used a batchSelection as follow:
renderContentOn: html html divNamed: 'bdList' with:[. html text: 'BDs'. html break. batch := WABatchSelection items: items link: #title text: #title. batch renderContentOn: html]
my domain objects have accents in its string representation and I do not know how from the model object I can specify that the text should be encoded.
------------------------------------------------------------------------ ------------------ In a batchSelection I wanted to have my own element displayer. Because I would like to have more information. Is it possible?
So if you really like seaside (like me for example) I can't imagine that you can only use it without willing to help making it better. So I'm sure that if we take each us some times to comment a bit the classes we know and the key methods in no time we will get a much better version. I think that this is our responsibility as a community to help seaside inventors to make it better.
Stef
On Sun, 28 Nov 2004 12:44:27 +0100, stephane ducasse stephane.ducasse@free.fr wrote:
In WAStoreFillCart>>displayItems: aCollection | list | aCollection size = 1 ifTrue: [^ self displayItem: aCollection first]. list := WABatchSelection items: aCollection link: #title text: #subtitle. [self displayItem: (main call: list)] repeat I do not understand the repeat.
It says #displayItem: the item chosen (from list). And do this repeatedly, ie. display the list allowing an item to be chosen.
batch renderContentOn: html]
should use #renderOn:.
my domain objects have accents in its string representation and I do not know how from the model object I can specify that the text should be encoded.
do you mean #text: vs. #html:?
On Sun, 28 Nov 2004 20:18:00 +0800, Yar Hwee Boon hboon@motionobj.com wrote:
batch renderContentOn: html]
should use #renderOn:.
In case I confused anyone, this should be #render: instead. Sorry.
Hi Stef,
Thanks for the detailed message. Comments and answers below.
- How can I get the WAAllTests running?
I added a initialize method so that we can get AllTests up and running in the browser.
The other way would be through the /seaside/config app: - add a new application named "tests" - choose WAAllTests as the root component
I guess like that so may be this should be in the distribution...
AllTests is really meant more as a (non-automated) regression test suite than as a set of examples. Ideally we would have a better/prettier set of components that were meant purely as examples.
- What is the process to add comments to seaside? Should we send
something to this list and avi will review it and include it?
Yes, preferably as a .mcz. If you have a bunch of comments to submit, it's probably best to just send one version that has all of them added.
- There are a lot of widgets but I could not find example (may be this
is in WAAllTests)? Is there a simple process to have examples of the widgets.
Actually, yes, although it's little known and little used (but please, let's change that). Just add class-side creation methods to subclasses of WAComponent, with selectors that start with #example. These will then automatically show up in WAExampleBrowser.
- Is there an FAQ? Is there a Wiki that we can add some examples?
- Is there a process to collect and document other widgets?
- Is there a database of widgets?
Not yet. These are definitly things we need to do. Does anybody want to volunteer to organize this?
Would he make sense to have www.seasideSource.com (a SqueakSource containing only seaside examples?)
That would certainly be one way to organize the above... if someone sets that up, I'll be happy to move the development of the Seaside package itself to it as well.
What is the difference between a task and a component?
This is a FAQ. Both of them are reusable, embeddable, callable pieces of user interface. A component has state (instance variables), behavior (it may change its state, and it may also choose to display other components with #call:), and appearance (it renders HTML). A Task has only the first two - it doesn't render any HTML directly, but only through the components it calls. This is useful when what you want to encapsulate/embed/call is purely a process (show this component, then this one, then this one).
The key method for WATask is #go - as soon as a task is displayed, this method will get invoked, and will presumably #call: other components.
What is the difference between renderOn: and renderContentOn:?
#renderOn: is the low level method that gets sent to any object encountered by the HtmlRenderer (for example, if you do "html bold: 'foo'", then String>>renderOn: will get called).
Components need to do various special things when they are rendered (for example, they need to render any Decoration objects that have been applied to them). So subclasses are expected to override #renderContentOn: instead (this is the Template Method pattern, I guess).
In WAStoreFillCart>>displayItems: aCollection | list | aCollection size = 1 ifTrue: [^ self displayItem: aCollection first]. list := WABatchSelection items: aCollection link: #title text: #subtitle. [self displayItem: (main call: list)] repeat
I do not understand the repeat.
Yeah, that's a little subtle. Why don't you try removing it and see what happens?
"self displayItem: (main call: list)" is letting the user pick and examine a single item from the collection. But usually when you're looking at a list of search results, you want to browse through many items. So all this is doing is letting you pick another one (by showing you the list again) when you're done with the first one.
my domain objects have accents in its string representation and I do not know how from the model object I can specify that the text should be encoded.
It's best to have your domain objects encoded in UTF-8; then you shouldn't need to do any conversion.
In a batchSelection I wanted to have my own element displayer. Because I would like to have more information. Is it possible?
Yes, if you look at WABatchSelection you'll see that the list of page numbers is in fact another, smaller component called WABatchedList. You can use WABatchedList with your own way of displaying the list. You give it the full collection with #items:, and retrieve and display just the current batch with #batch.
So if you really like seaside (like me for example) I can't imagine that you can only use it without willing to help making it better. So I'm sure that if we take each us some times to comment a bit the classes we know and the key methods in no time we will get a much better version. I think that this is our responsibility as a community to help seaside inventors to make it better.
I certainly won't argue with that :).
Avi
On Sun, 28 Nov 2004 13:20:07 +0100, Avi Bryant avi.bryant@gmail.com wrote:
- Is there an FAQ? Is there a Wiki that we can add some examples?
- Is there a process to collect and document other widgets?
- Is there a database of widgets?
Not yet. These are definitly things we need to do. Does anybody want to volunteer to organize this?
If there's no other takers, I'd be happy to help.
seaside@lists.squeakfoundation.org