[Seaside] WAComponent>>#call:/#answer: usage question
Damien Cassou
damien.cassou at gmail.com
Tue Aug 21 15:25:52 UTC 2007
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']]]
--
Damien Cassou
More information about the seaside
mailing list