[Seaside] Question

Julian Fitzell julian at beta4.com
Wed Jan 7 05:20:08 CET 2004

Hi Raymond,

Raymond Asselin wrote:

> Changed the subject:  :)
> - How to expand the width of a field. Say I have a field for an adress on my ŒSeaside¹ web page,
> how can I change the current width of that field ? 

The easiest way is to use the #textInputOn:of:size: method of 
WAHtmlRenderer.  The first parameter is a selector to call on the second 
parameter to get a value for the text input.

So you might do:

renderContentOn: html
    html form: [html textInputOn: #foo of: self size: 20]

Another option is to add the attribute yourself (but you'd presumably 
only do this if you weren't using #textInputOn:of: already):

renderContentOn: html
    html form: [
       html attributes size: 20.
       html textInputWithValue: self foo callback: [:v | self foo: v]]

> - Suppose I split the page on 2 pane using a css. Say pane1 and pane2 . So I link the pane1 to a
> component, pane2 to another .  If pane1 is used by component11 which call component22, and
> component22 call component33 --now I am at the component33 level -- how can I access instance
> variable of the component11 ?  I also want that when the component33 task is over all component
> unroll until component11.

I don't really know what you're asking here.  What do you mean by 
"pane"?  The general issue of how you access instance variables of 
parent components however is solved the same way as in any other 
programming:  Do you really want component33 to be mucking with the 
instance variables of component11?  Generally you're going to want to 
pass any necessary information into the child components, otherwise the 
components become very fragile; they get locked in so they don't work if 
you put them inside a different parent.

When you call a component, it's a lot like making a method call.  You 
want to set up the component with any necessary parameters before 
calling it.  Then when the component answers (using "self answer" or 
"self answer: foo") control flow will revert back to the calling component.

So, assume component11 calls component22 as follows:

    |component22 result|
    component22 := Component22 new.
    component22 foo: #bar.

    result := self call: component22.
    self inform: result.

The user then clicks something and component22 does:

    self answer: (self call: Component33 new)

Then perhaps the user enters a value in component33 and clicks a button:

    self answer: userValue

So now component33 will return the user's value to component22. 
Component22 will in turn return the value back to component11, which 
then displays the value (using #inform:) to the user.

Hopefully that sort of answers your question.  If not, try giving a more 
concrete example of what you're trying to do and someone can give you 
some pointers.


julian at beta4.com
Beta4 Productions (http://www.beta4.com)

More information about the Seaside mailing list