[Seaside] radioButton #value and group callback

Julian Fitzell jfitzell at gmail.com
Sun Apr 18 18:21:16 UTC 2010


I don't recall the original discussion but this was added a few months ago
and was needed for something. What you need is for the last line to be
changed to:

 group hasCallback
ifTrue: [ super value: (group callbackValue: anObject) ]
ifFalse: [ super value: anObject ]

Is that right?

Julian

On Sun, Apr 18, 2010 at 11:26 AM, Nick Ager <nick.ager at gmail.com> wrote:

> Hi,
>
> I'm defining set of radio buttons in Seaside 3. My initial attempt was:
>
>     html radioGroup
> selected: 6;
>  with: [ :group |
>  optionDescriptions doWithIndex: [:each :index|
>  html radioButton
> group: group;
> value: index;
>  title: each
>  ]
>  ]
>
> This generated a set of radio buttons without the "value" attribute. I
> found the cause in:
>
> WARadioButtonTag>>value: anObject
> group isNil
> ifTrue: [ ^ super value: anObject ].
>  group hasSelection
> ifTrue: [ self selected: (group isSelected: anObject) ].
>  group hasCallback
> ifTrue: [ super value: (group callbackValue: anObject) ]
>
> so the fix was to define a callback for radioGroup. As I'm using Ajax to
> read the value from the radio buttons, I defined an empty callback. I think
> I can see the rational for this line of code, but in my case it
> was counterintuitive.
>
> Is the check for the callback really necessary? Could it be removed?
>
> Thanks
>
> Nick
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100418/874c90a1/attachment.htm


More information about the seaside mailing list