[Seaside] WAComponent>>#call:/#answer: usage question

John Thornborrow john at pinesoft.co.uk
Tue Aug 21 16:05:24 UTC 2007

Hi Damien,

Thanks, I did try a task, but I hit another problem with that which I
shall save for another day..

The scenario includes that I must have a link to reset the content
instvar via an anchor; which I failed to explain in my example.

So that means one of a few scenarios must be possible (or other that I
am not aware of, of course - and please note these are not demands, they
are merely user stories.)

1.) If using a WATask, I must be able to simultaneously #call: twice.
2.) The WATask must be able to render the Heading and Anchor.
3.) If I make a separate component for the heading and anchor, then
#render: those components, it must be able to #answer: for it's parent

Now I am fully aware I could create a #parent:/#parent method on my
title object,  then use "self parent answer: 'foobar'", or simply render
the heading and anchor on every component (messy..) but I did think "I
surely cannot be the first person to encounter this?" thus I posted the
previous question :)

Best Regards,

Damien Cassou wrote:
> Hi John,
> 2007/8/21, John Thornborrow <john at pinesoft.co.uk>:
>> The below #renderContentOn: does not render, nor does the #call:'ed
>> component; I receive only a blank page.
> You must not send #call: during the rendering. Only during callbacks
> (after a click on a link for example). (Note for the others: I think
> this problem should be dealt with in the FAQ).
> You might probably want to use a WATask or change a bit the flow of
> your application. See documentation at http://www.seaside.st.
> A non-related note: use (Smalltalk classNamed: aSymbol) instead of
> (Smalltalk at: aSymbol). This is clearer.
>> I understand there have been some changes to the #call:/#answer:
>> methods, however I cannot find any reference to what I can use instead.
>> Any assistance is appreciated, thanks.
>> The code:
>> ==
>> FVAdmin>>#initialize
>>   options _ Dictionary new
>>     at: 'user' put: #FVAdminUser;
>>     at: 'blogCreate' put: #FVBlogCreate;
>>     at: 'moderation' put: #FVModeration;
>>     at: 'articleCreate' put: #FVAdminArticle;
>>     at: 'imageUpload' put: #FVImageUpload;
>>     at: 'subscriptionAdmin' put: #FVAdminSubscriptions;
>>     yourself.
>>   content := FVAdminOptions new registry: self registry.
>>   ^super initialize
>> FVAdmin>>#renderContentOn: html
>>   html heading level: 2; with: [
>>    html text: 'Administration Area'].
>>   self content: (self call: content)
>> FVAdmin>>#content: aString
>>   | cont |
>>   cont := options
>>     at: aString
>>     ifAbsent: [self error: 'Incorrect Option Chosen: ', aString].
>>   content := (Smalltalk at: cont) new registry: self registry
>> FVAdminOptions>>#renderContentOn: html
>>   html unorderedList with: [
>>     html listItem with: [
>>       html anchor
>>         callback: [self answer: 'user'];
>>         with: [html text: 'User Administration']].
>>     html listItem with: [
>>       html anchor
>>         callback: [self answer: 'articleCreate'];
>>         with: [html text: 'Create New/Edit existing Analysis Article']].
>>     html listItem with: [
>>       html anchor
>>         callback: [self answer: 'imageUpload'];
>>         with: [html text: 'Upload Images']].
>>     html listItem with: [
>>       html anchor
>>         callback: [self answer: 'subscriptionAdmin'];
>>         with: [html text: 'Administer Subscriptions']]]

Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA

This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com

More information about the seaside mailing list