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

John Thornborrow john at pinesoft.co.uk
Tue Aug 21 17:14:39 UTC 2007

Hi Lukas,

1.) Yes, I need something like #show: but I do require a result (via
#answer: would be the logical choice). There will of course only be one
answer at a time, but I want to present the options from two components
on the same page.

2.) I realise WATask does not render, hence my trial with WAComponent
subclass and #call:

3.) I am expecting a result; in FVAdminOptions>>#renderContentOn: it can
be noted that each listitem contains and anchor with a callback of "self
answer: 'foobar'". Each of these results in the rendering of a different
component in place of FVAdminOptions, which also #answer:.

I'm currently toying with a task, as it is the closest I have to what I
need, but it is restricting me from using a separate component for the
anchor which will be used to reset the content. In other words, I am
forced to implement the lines:

html heading
  level: 2;
  with: [html text: 'Administration Area'].
html anchor
  callback: [self answer: 'options'];
  with: [html text: '[Return to Options]']

in every class I have as options (currently 4, but there will be more.)
What I would like to achieve is to have that separated into it's own
component, but because of the callback: [self answer: 'options'] I
cannot do so.

Best regards,


Lukas Renggli wrote:
>> 1.) If using a WATask, I must be able to simultaneously #call: twice.
> That doesn't really make sense, because #call: replaces an entire
> component with a new one.
> In case you really want to change two components at once you can use
> #show: that does not block (check out the comments of the methods
> #call: and #show:).
>> 2.) The WATask must be able to render the Heading and Anchor.
> WATask does not render anything (check out the class comment). It just
> delegates the rendering to a sequenze of other components.
>> 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
>> component.
> It looks like you need to compose your components, not to #call: them.
> #call: is only useful if you expect to get back a result (read the
> class comment of WAComponent).
> HTH,
> Lukas

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