RadioGroup problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RadioGroup problem

Ken Causey-3
I'm creating a set of radio buttons with (for example):

html radioButtonInGroup: 'person'
        selected: (selectedChoice = choice)
        callback: [ :newChoice |
                self halt.
                newChoice = aChoiceQuestion default ifFalse: [
                response recordChoice: newChoice
                        for: aChoiceQuestion ] ].

This is within a WAFormDialog subclass.  The callback never gets called.
I've even tried it without specifying any buttons and just leaving the
default call/answer support.  What am I doing wrong?

I should clarify that the code above is actually called from another
class that is called from renderDialogOn: through some redirection.  But
it uses the same WAHtmlRenderer instance.

Ken

P.S. Again I'm on #squeak although probably for only another 30 minutes
or so tonight.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RadioGroup problem

Avi  Bryant

On Jun 5, 2006, at 4:03 PM, Ken Causey wrote:

> I'm creating a set of radio buttons with (for example):
>
> html radioButtonInGroup: 'person'
> selected: (selectedChoice = choice)
> callback: [ :newChoice |
> self halt.
> newChoice = aChoiceQuestion default ifFalse: [
> response recordChoice: newChoice
> for: aChoiceQuestion ] ].
>
> This is within a WAFormDialog subclass.  The callback never gets  
> called.
> I've even tried it without specifying any buttons and just leaving the
> default call/answer support.  What am I doing wrong?

Don't give your radio group a name; instead, generate an identifier  
for it with #radioGroup ahead of time (store that in a temp and keep  
using it).

Avi
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: RadioGroup problem

Ken Causey-3
In reply to this post by Ken Causey-3
Ok, with another day I was able to find my own problem.  For the record
and the education of others the first argument to
WAHtmlRenderer>>#radioButtonInGroup:selected:callback: should be the
result of a WAHtmlRenderer>>#radioGroup message.  I really should have
noticed a smell when I was having (or so I thought) to specify a
'special' name, but I didn't.  Secondly there is no argument sent to the
callback instead you should simply capture the value (in this case
'choice') that this particular radio button represents in the callback
closure.  So something more like:

group := html radioGroup.
choices do: [ :choice |
        html radioButtonInGroup: group
                selected: (selectedChoice = choice)
                callback: [
                        choice = aChoiceQuestion default ifFalse: [
                                response recordChoice: choice
                                        for: aChoiceQuestion ] ] ]

Ken

On Mon, 2006-06-05 at 18:03 -0500, Ken Causey wrote:

> I'm creating a set of radio buttons with (for example):
>
> html radioButtonInGroup: 'person'
> selected: (selectedChoice = choice)
> callback: [ :newChoice |
> self halt.
> newChoice = aChoiceQuestion default ifFalse: [
> response recordChoice: newChoice
> for: aChoiceQuestion ] ].
>
> This is within a WAFormDialog subclass.  The callback never gets called.
> I've even tried it without specifying any buttons and just leaving the
> default call/answer support.  What am I doing wrong?
>
> I should clarify that the code above is actually called from another
> class that is called from renderDialogOn: through some redirection.  But
> it uses the same WAHtmlRenderer instance.
>
> Ken
>
> P.S. Again I'm on #squeak although probably for only another 30 minutes
> or so tonight.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (196 bytes) Download Attachment