Hello again,
I am having some trouble working with radiobuttons: I have a component with 3 counters: #lectureCount, #labCount and #tutorialCount. Then I have 4 radiobuttons: #free, #lecture, #lab and #tutorial. Then I have an onChange: ((html jQuery #XXXcount) load html: [:h | h render: (XXXcount := XXXcount +1)]) for each of the lecture, lab and tutorial button. What I am trying to do is decrease the counter that is associated with the previously selected radioButton. For example if I had the #lecture radioButton selected, when I pick the #lab button instead it increases the #labCount but I would like also to decrease the #lectureCount. So in effect I need to: a) find out which button was selected. b) have multiple actions with onChange : (increase one counter and decrease another). Also, I was under the impression that using (html jQuery this attributeAt: 'selected') on a radioButton would give me a boolean value, but it seems it's not the case and I don't understand why. Thanks, Gilles _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
I would use the jQuery val() function (Smalltalk #value), but I don't
have an image here in the Buenos Aires parc to test. Lukas On Saturday, November 20, 2010, Gilles Schtickzelle <[hidden email]> wrote: > Hello again, > > I am having some trouble working with radiobuttons: > > I have a component with 3 counters: #lectureCount, #labCount and #tutorialCount. > Then I have 4 radiobuttons: #free, #lecture, #lab and #tutorial. > > Then I have an onChange: ((html jQuery #XXXcount) load html: [:h | h render: (XXXcount := XXXcount +1)]) for each of the lecture, lab and tutorial button. > > What I am trying to do is decrease the counter that is associated with the previously selected radioButton. > > For example if I had the #lecture radioButton selected, when I pick the #lab button instead it increases the #labCount but I would like also to decrease the #lectureCount. > So in effect I need to: a) find out which button was selected. b) have multiple actions with onChange : (increase one counter and decrease another). > > Also, I was under the impression that using (html jQuery this attributeAt: 'selected') on a radioButton would give me a boolean value, but it seems it's not the case and I don't understand why. > > Thanks, > Gilles > > -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Gilles Schtickzelle
You might consider writing a method to handle that. It'll end up being a lot more organized as well.
Maybe something along these lines: " ... " onChange: (html jQuery ajax script: [:s | s add: ( self select: #whicheverButtonIsBeingClicked on: s ) ]); " ... " #select: aSymbolOrIdentifierOfSomeSort on: html "if lab, increase lab, decrease lecture or whatever" "return some javascript to reflect changes" "if ... " " etc ... " RS
Date: Sat, 20 Nov 2010 15:58:26 +0100 From: [hidden email] To: [hidden email] Subject: [Seaside] headache with radiobuttons Hello again, I am having some trouble working with radiobuttons: I have a component with 3 counters: #lectureCount, #labCount and #tutorialCount. Then I have 4 radiobuttons: #free, #lecture, #lab and #tutorial. Then I have an onChange: ((html jQuery #XXXcount) load html: [:h | h render: (XXXcount := XXXcount +1)]) for each of the lecture, lab and tutorial button. What I am trying to do is decrease the counter that is associated with the previously selected radioButton. For example if I had the #lecture radioButton selected, when I pick the #lab button instead it increases the #labCount but I would like also to decrease the #lectureCount. So in effect I need to: a) find out which button was selected. b) have multiple actions with onChange : (increase one counter and decrease another). Also, I was under the impression that using (html jQuery this attributeAt: 'selected') on a radioButton would give me a boolean value, but it seems it's not the case and I don't understand why. Thanks, Gilles _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi All,
I was just trying out the jQuery autocomplete, and it bites the dust when trying to call: GRNullCodecStream-#json: The #json: method is implemented in Stream, so i'm guessing this is just an oversight while greasing up the seaside. I've added the method to GRCodecStream and all seems good again. If this is not an oversight, please let me know with a hint on how i should be using it :) Cheers, Phil_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
sorry - i think this is GemStone specific. please disregard.
On 23/11/2010, at 12:50 PM, Phil wrote: > Hi All, > > I was just trying out the jQuery autocomplete, and it bites the dust when trying to call: > > GRNullCodecStream-#json: > > The #json: method is implemented in Stream, so i'm guessing this is just an oversight while greasing up the seaside. I've added the method to GRCodecStream and all seems good again. > > If this is not an oversight, please let me know with a hint on how i should be using it :) > > Cheers, > > Phil_______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |