Is there a reason why this RadioButton group doesn't ever call the callback?

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

Is there a reason why this RadioButton group doesn't ever call the callback?

Andy Burnett
Hello

I am sure I am missing something very obvious - hence the posting on the beginners' list.

I am working through the seaside book, and everything has been fine, until I tried to replace my select item with a radio group. The form renders correctly, but never fires the callbacks.  Could someone poke me with a clue stick?  By the way, the self halts are in there because when I put the halt commands in the beMale beFemale methods, they never fired either. So I was working my way back up the chain.

The strange thing is that the other text input boxes (removed in this snippet) updated the model correctly.

renderContentOn:html
| group |
html form:
[
group := html radioGroup.
html text:'male'.
html radioButton
group: group;
selected: self contact isMale;
callback: [self halt].
html text: 'female'.
html radioButton
group: group;
selected: self contact isFemale;
callback: [self halt].
html submitButton on: #save of:self.
]

Cheers
Andy

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

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

John McKeon
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

On Tue, Apr 27, 2010 at 4:20 PM, Andy Burnett <[hidden email]> wrote:
Hello

I am sure I am missing something very obvious - hence the posting on the beginners' list.

I am working through the seaside book, and everything has been fine, until I tried to replace my select item with a radio group. The form renders correctly, but never fires the callbacks.  Could someone poke me with a clue stick?  By the way, the self halts are in there because when I put the halt commands in the beMale beFemale methods, they never fired either. So I was working my way back up the chain.

The strange thing is that the other text input boxes (removed in this snippet) updated the model correctly.

renderContentOn:html
| group |
html form:
[
group := html radioGroup.
html text:'male'.
html radioButton
group: group;
selected: self contact isMale;
callback: [self halt].
html text: 'female'.
html radioButton
group: group;
selected: self contact isFemale;
callback: [self halt].
html submitButton on: #save of:self.
]

Cheers
Andy

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners




--
http://john-mckeon.us/seaside

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

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

Andy Burnett
In reply to this post by Andy Burnett
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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

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

John McKeon
Did you add the submitOnClick sends to the radioButton tags?

On Tue, Apr 27, 2010 at 9:17 PM, Andy Burnett <[hidden email]> 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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners




--
http://john-mckeon.us/seaside

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

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

John McKeon
You probably don't want that if you have other inputs on the form anyway. You really should be posting this to the Seaside list as well. You would probably have your answer by now.

John

On Tue, Apr 27, 2010 at 9:37 PM, John McKeon <[hidden email]> wrote:
Did you add the submitOnClick sends to the radioButton tags?

On Tue, Apr 27, 2010 at 9:17 PM, Andy Burnett <[hidden email]> 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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners




--
http://john-mckeon.us/seaside

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

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

Andy Burnett
In reply to this post by Andy Burnett
John McKeon wrote

<<<

You probably don't want that if you have other inputs on the form anyway.
You really should be posting this to the Seaside list as well. You would
probably have your answer by now.

John

>>>

Thanks John, I will move it over to that list now. My assumption was that it was a very basic mistake on my part. However, it seems as though it may be more complicated than that.

Cheers
Andy



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners