[Newbies] Re: Is there a reason why this RadioButton group doesn't ever call the callback?

John McKeon p3anoman at gmail.com
Wed Apr 28 01:37:35 UTC 2010


Did you add the submitOnClick sends to the radioButton tags?

On Tue, Apr 27, 2010 at 9:17 PM, Andy Burnett <
andy.burnett at knowinnovation.com> wrote:

> John McKeon wrote:
>
> <<<
> Hey Andy
> I have a radio group defined like this (using your code):
>
> renderContentOn:html
> | group |
> html form:
>  [
> html radioGroup [ :rg |
> rg radioButton
>                         submitOnClick;
> selected: self contact isMale;
> callback: [self halt];
>                         with: [html text:'male'].
>                 rg radioButton...etc
> ]
> Hope that helps
> John
> >>>
>
> Thanks John,
> That does fix part of the problem. Initially the radio buttons weren't
> actually in concert - the code in the Seaside book wasn't producing
> 'name="something"' code.  I wonder whether that code would ever work?
>
> Anyway, unfortunately, the callbacks are still not working. It is very odd.
>  The form renders properly, it is just that the callbacks never fire.  The
> code below shows two version - radio button and select statement. The select
> version works perfectly.  I would be really interested to know how to go
> about debugging this.
>
> renderContentOn:html
>
> html form:
> [
> html radioGroup: [ :rg |
>  rg radioButton
> selected: self contact isMale;
> callback: [self contact beMale];
>                         with: [html text:'male'].
> rg radioButton
> selected: self contact isFemale;
>  callback: [self contact beFemale];
>                         with: [html text:'female'].
>
> ].
> html select
> list: #(#Male #Female);
> selected: self contact gender;
>  callback: [:value| (value=#Male) ifTrue:[self contact beMale]
> ifFalse:[self contact beFemale]].
> html submitButton on: #save of:self.
> ]
>
> Cheers
> Andy
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>


-- 
http://john-mckeon.us/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20100427/8e4887af/attachment-0001.htm


More information about the Beginners mailing list