[Seaside] Re: Multiple submit buttons/links?
Boris Popov
popov at shaw.ca
Sat Jun 17 15:34:53 UTC 2006
Carl Gundel wrote:
>> How can I create more than one button or link on a page that causes the
>> callbacks to be invoked for each component, even for pages that are
> composed
>> of one or more non-nested forms? Is there a simple way provided in the
>> framework?
>
> Well, with some spelunking we managed to find
> #anchorWithAction:text:submitFormNamed: which lets us have multiple anchors
> and each can cause a submit. These are links but using CSS we can make the
> links look like buttons.
>
> html attributes name: #activeStuff.
> html form:
> [ html textInputWithCallback: [:value | self name: value].
> "here is a nested form which also has an anchor"
> super renderContentOn: html].
> html
> anchorWithAction: [self doThis ]
> text: 'this text'
> submitFormNamed: #activeStuff.
> html
> anchorWithAction: [self doThat ]
> text: 'that text'
> submitFormNamed: #activeStuff.
>
> Problem solved. I hope this helps somebody. :-)
>
You can also do that with actual buttons. Attached is an extension of
WASubmitButtonTag that borrows javascript snippet from an anchor and a
demo application in Login.st,
Note that this all using the new render canvas API, which I highly
recommend over the old way of doing things anyway.
Hope this helps,
-Boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WASubmitButtonTag-submitFormNamed.st
Type: text/xml
Size: 446 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20060617/f335bca5/WASubmitButtonTag-submitFormNamed.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Login.st
Type: text/xml
Size: 2664 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20060617/f335bca5/Login.bin
More information about the Seaside
mailing list