Arc Forumnew | comments | leaders | submitlogin
1 point by cwp 6128 days ago | link | parent

Nice idea, but it doesn't work. It should be something like this:

    renderContentOn: html
        said 
            ifNil: 
                [html form: [html textInput callback: [:v | said := v]. 
                html submitButton]]
            ifNotNil:
                [clicked 
                    ifNil: [html anchor callback: [clicked := true]; with: 'click here']
                    ifNotNil: [html text: 'You said: ', said]].
A more elegant implementation might use the lower levels of Seaside directly, and dispense with components completely. But Arc is about brevity, not elegance, right?


2 points by pc 6128 days ago | link

Well, even that code omits the definition of "said" and "clicked". (The latter is unnecessary as far as I can see.)

I agree that mine isn't precisely by the spec -- you have to press 'enter' to submit the form, and there's an ok button on the last page -- but these are fairly trivial differences in presentation due to the behaviour of the built-in libraries.

(also, minor footnote: I'm assuming that "foo", "said" and "clicked" are instance variables in each example.)

-----