Return-Path: X-Original-To: apmail-flex-dev-archive@www.apache.org Delivered-To: apmail-flex-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4FB93FB4B for ; Fri, 10 May 2013 14:46:17 +0000 (UTC) Received: (qmail 95519 invoked by uid 500); 10 May 2013 14:46:16 -0000 Delivered-To: apmail-flex-dev-archive@flex.apache.org Received: (qmail 95407 invoked by uid 500); 10 May 2013 14:46:16 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 95391 invoked by uid 99); 10 May 2013 14:46:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 May 2013 14:46:15 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pent@adobe.com designates 64.18.1.189 as permitted sender) Received: from [64.18.1.189] (HELO exprod6og105.obsmtp.com) (64.18.1.189) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 May 2013 14:46:09 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob105.postini.com ([64.18.5.12]) with SMTP ID DSNKUY0IGmWfeu4rJ7tCCJkMPJ6cZUB431iw@postini.com; Fri, 10 May 2013 07:45:48 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4b [10.128.4.237]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r4AEjj99028823; Fri, 10 May 2013 07:45:45 -0700 (PDT) Received: from nacas02.corp.adobe.com (nacas02.corp.adobe.com [10.8.189.100]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id r4AEjiGU017879; Fri, 10 May 2013 07:45:44 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nacas02.corp.adobe.com ([10.8.189.100]) with mapi; Fri, 10 May 2013 07:45:43 -0700 From: Peter Ent To: "dev@flex.apache.org" , "commits@flex.apache.org" Date: Fri, 10 May 2013 07:45:41 -0700 Subject: Re: git commit: [flex-asjs] [refs/heads/develop] - RadioButtons for jQuery. RadioButtons cannot be programmatically added due to a known jQuery bug (documented in the RadioButton.js file). Thread-Topic: git commit: [flex-asjs] [refs/heads/develop] - RadioButtons for jQuery. RadioButtons cannot be programmatically added due to a known jQuery bug (documented in the RadioButton.js file). Thread-Index: Ac5NjQwih1b+S+lGT26PYmceLmQTkA== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.2.130206 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org The jQuery JS files do not get injected - you have to do it manually. I will check in my sample today and the instructions are in the main app.mxml file. --peter On 5/9/13 5:04 PM, "Alex Harui" wrote: >Excellent. > >One question though: if you took out jquery.Application, how do the Jquery >JS files get injected? > >-Alex > > >On 5/9/13 1:33 PM, "pent@apache.org" wrote: > >> Updated Branches: >> refs/heads/develop 0991467eb -> 114aeec95 >> >> >> RadioButtons for jQuery. RadioButtons cannot be programmatically added >>due to >> a known jQuery bug (documented in the RadioButton.js file). >> >> >> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo >> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/114aeec9 >> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/114aeec9 >> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/114aeec9 >> >> Branch: refs/heads/develop >> Commit: 114aeec95635a765abc6e527517de984cd2dfadd >> Parents: 0991467 >> Author: Peter Ent >> Authored: Thu May 9 16:33:01 2013 -0400 >> Committer: Peter Ent >> Committed: Thu May 9 16:33:01 2013 -0400 >> >> ---------------------------------------------------------------------- >> frameworks/as/jquery-manifest.xml | 1 - >> .../apache/flex/html/staticControls/RadioButton.as | 6 + >> .../as/src/org/apache/flex/jquery/Application.as | 43 ---- >> .../flex/jquery/staticControls/RadioButton.as | 4 + >> .../org/apache/flex/html/staticControls/Label.js | 14 ++ >> .../apache/flex/html/staticControls/RadioButton.js | 16 ++ >> .../src/org/apache/flex/jquery/Application.js | 114 ----------- >> .../flex/jquery/staticControls/RadioButton.js | 158 >>++++++++++++--- >> 8 files changed, 169 insertions(+), 187 deletions(-) >> ---------------------------------------------------------------------- >> >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/as/j >> query-manifest.xml >> ---------------------------------------------------------------------- >> diff --git a/frameworks/as/jquery-manifest.xml >> b/frameworks/as/jquery-manifest.xml >> index cdb9dd5..d760aff 100644 >> --- a/frameworks/as/jquery-manifest.xml >> +++ b/frameworks/as/jquery-manifest.xml >> @@ -21,7 +21,6 @@ >> >> >> >> - >class=3D"org.apache.flex.jquery.Application"/> >> > class=3D"org.apache.flex.jquery.staticControls.TextButton"/> >> > class=3D"org.apache.flex.jquery.staticControls.CheckBox"/> >> > class=3D"org.apache.flex.jquery.staticControls.RadioButton"/> >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/as/s >> rc/org/apache/flex/html/staticControls/RadioButton.as >> ---------------------------------------------------------------------- >> diff --git >> a/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as >> b/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as >> index 0aee02b..a6caf5b 100644 >> --- >>a/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as >> +++ >>b/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as >> @@ -19,6 +19,7 @@ >> package org.apache.flex.html.staticControls >> { >> import flash.display.DisplayObject; >> + import flash.display.DisplayObjectContainer; >> import flash.display.SimpleButton; >> import flash.events.MouseEvent; >> import flash.utils.Dictionary; >> @@ -111,6 +112,11 @@ package org.apache.flex.html.staticControls >> IValueToggleButtonModel(model).selectedValue =3D >> newValue; >> } >> >> + public function >>addToParent(p:DisplayObjectContainer):void >> + { >> + p.addChild(this); >> + } >> + >> public function initModel():void >> { >> if (getBeadByType(IValueToggleButtonModel) =3D= =3D >>null) >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/as/s >> rc/org/apache/flex/jquery/Application.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/as/src/org/apache/flex/jquery/Application.as >> b/frameworks/as/src/org/apache/flex/jquery/Application.as >> deleted file mode 100644 >> index 5801d07..0000000 >> --- a/frameworks/as/src/org/apache/flex/jquery/Application.as >> +++ /dev/null >> @@ -1,43 +0,0 @@ >> >>-//////////////////////////////////////////////////////////////////////// >>///// >> /// >> -// >> -// Licensed to the Apache Software Foundation (ASF) under one or more >> -// contributor license agreements. See the NOTICE file distributed >>with >> -// this work for additional information regarding copyright ownership. >> -// The ASF licenses this file to You under the Apache License, >>Version 2.0 >> -// (the "License"); you may not use this file except in compliance >>with >> -// the License. You may obtain a copy of the License at >> -// >> -// http://www.apache.org/licenses/LICENSE-2.0 >> -// >> -// Unless required by applicable law or agreed to in writing, software >> -// distributed under the License is distributed on an "AS IS" BASIS, >> -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >>implied. >> -// See the License for the specific language governing permissions and >> -// limitations under the License. >> -// >> >>-//////////////////////////////////////////////////////////////////////// >>///// >> /// >> -package org.apache.flex.jquery >> -{ >> - import flash.display.Sprite; >> - import flash.display.StageAlign; >> - import flash.display.StageScaleMode; >> - import flash.events.IOErrorEvent; >> - >> - import org.apache.flex.core.Application; >> - import org.apache.flex.core.IFlexInfo; >> - import org.apache.flex.events.Event; >> - import org.apache.flex.utils.MXMLDataInterpreter; >> - >> - //-------------------------------------- >> - // Events >> - //-------------------------------------- >> - >> - /** >> - * Dispatched at startup. >> - */ >> - [Event(name=3D"initialize", type=3D"org.apache.flex.events.Event")] >> - >> - public class Application extends org.apache.flex.core.Application >> implements IFlexInfo >> - { >> - } >> -} >> \ No newline at end of file >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/as/s >> rc/org/apache/flex/jquery/staticControls/RadioButton.as >> ---------------------------------------------------------------------- >> diff --git >> a/frameworks/as/src/org/apache/flex/jquery/staticControls/RadioButton.as >> b/frameworks/as/src/org/apache/flex/jquery/staticControls/RadioButton.as >> index a94739a..aac1ad5 100644 >> --- >>a/frameworks/as/src/org/apache/flex/jquery/staticControls/RadioButton.as >> +++ >>b/frameworks/as/src/org/apache/flex/jquery/staticControls/RadioButton.as >> @@ -22,5 +22,9 @@ package org.apache.flex.jquery.staticControls >> >> public class RadioButton extends >> org.apache.flex.html.staticControls.RadioButton >> { >> + override public function initModel():void >> + { >> + super.initModel(); >> + } >> } >> } >> \ No newline at end of file >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/js/F >> lexJS/src/org/apache/flex/html/staticControls/Label.js >> ---------------------------------------------------------------------- >> diff --git >> a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js >> b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js >> index 875607a..55d1361 100644 >> --- >>a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js >> +++ >>b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js >> @@ -40,6 +40,20 @@ >> org.apache.flex.html.staticControls.Label.prototype.addToParent =3D >>function(p) >> { >> this.positioner =3D this.element; >> }; >> >> +/** >> + * @expose >> + * @this {org.apache.flex.html.staticControls.Label} >> + */ >> +org.apache.flex.html.staticControls.Label.prototype.initModel =3D >>function() { >> +}; >> +/** >> + * @expose >> + * @this {org.apache.flex.html.staticControls.Label} >> + */ >> +org.apache.flex.html.staticControls.Label.prototype.initSkin =3D >>function() { >> + >> +}; >> + >> >> /** >> * @expose >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/js/F >> lexJS/src/org/apache/flex/html/staticControls/RadioButton.js >> ---------------------------------------------------------------------- >> diff --git >> >>a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButto >>n.js >> >>b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButto >>n.js >> index fb657b2..e8f67d6 100644 >> --- >> >>a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButto >>n.js >> +++ >> >>b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButto >>n.js >> @@ -51,6 +51,22 @@ >> org.apache.flex.html.staticControls.RadioButton.prototype.addToParent = =3D >> rb.flexjs_wrapper =3D this; >> }; >> >> +/** >> + * @expose >> + * @this {org.apache.flex.html.staticControls.RadioButton} >> + */ >> +org.apache.flex.html.staticControls.RadioButton.prototype.initModel =3D >> +function() { >> +}; >> + >> +/** >> + * @expose >> + * @this {org.apache.flex.html.staticControls.RadioButton} >> + */ >> +org.apache.flex.html.staticControls.RadioButton.prototype.initSkin =3D >> +function() { >> +}; >> + >> >> /** >> * @expose >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/js/F >> lexJS/src/org/apache/flex/jquery/Application.js >> ---------------------------------------------------------------------- >> diff --git >>a/frameworks/js/FlexJS/src/org/apache/flex/jquery/Application.js >> b/frameworks/js/FlexJS/src/org/apache/flex/jquery/Application.js >> deleted file mode 100644 >> index e6eb0f8..0000000 >> --- a/frameworks/js/FlexJS/src/org/apache/flex/jquery/Application.js >> +++ /dev/null >> @@ -1,114 +0,0 @@ >> -/** >> - * Licensed under the Apache License, Version 2.0 (the "License"); >> - * you may not use this file except in compliance with the License. >> - * You may obtain a copy of the License at >> - * >> - * http://www.apache.org/licenses/LICENSE-2.0 >> - * >> - * Unless required by applicable law or agreed to in writing, software >> - * distributed under the License is distributed on an "AS IS" BASIS, >> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >>implied. >> - * See the License for the specific language governing permissions and >> - * limitations under the License. >> - */ >> - >> -// ------------------------------------------------------------------ >> -// jQuery >> -// ------------------------------------------------------------------ >> - >> -// (erikdebruin) do these have to be in the global namespace? >> -var head, link, mainjs, uijs; >> - >> -// Bring in the jQuery sources. You can use the minified versions for >> -// better performance. >> -mainjs =3D document.createElement('script'); >> -/** @type {Object} */ mainjs.src =3D >>'http://code.jquery.com/jquery-1.9.1.js'; >> -document.head.appendChild(mainjs); >> - >> -uijs =3D document.createElement('script'); >> -/** @type {Object} */ uijs.src =3D >> - 'http://code.jquery.com/ui/1.10.2/jquery-ui.js'; >> -document.head.appendChild(uijs); >> - >> -// create a stylesheet link to the corresponding jquery theme file. >> -head =3D document.getElementsByTagName('head')[0]; >> -link =3D document.createElement('link'); >> -/** @type {Object} */ link.id =3D 'jquerycss'; >> -/** @type {Object} */ link.rel =3D 'stylesheet'; >> -/** @type {Object} */ link.type =3D 'text/css'; >> -/** @type {Object} */ link.href =3D >> - 'http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css'; >> -/** @type {Object} */ link.media =3D 'all'; >> -head.appendChild(link); >> - >> -// ------------------------------------------------------------------ >> -// end jQuery >> -// ------------------------------------------------------------------ >> - >> -goog.provide('org.apache.flex.jquery.Application'); >> - >> -goog.require('org.apache.flex.core.HTMLElementWrapper'); >> -goog.require('org.apache.flex.utils.MXMLDataInterpreter'); >> - >> - >> - >> -/** >> - * @constructor >> - * @extends {org.apache.flex.core.HTMLElementWrapper} >> - */ >> -org.apache.flex.jquery.Application =3D function() { >> - goog.base(this); >> - >> -}; >> -goog.inherits(org.apache.flex.jquery.Application, >> - org.apache.flex.core.HTMLElementWrapper); >> - >> - >> -/** >> - * @expose >> - * @type {Object} >> - */ >> -org.apache.flex.jquery.Application.prototype.controller =3D null; >> - >> - >> -/** >> - * @expose >> - * @type {org.apache.flex.core.ViewBase} >> - */ >> -org.apache.flex.jquery.Application.prototype.initialView =3D null; >> - >> - >> -/** >> - * @expose >> - * @type {org.apache.flex.events.EventDispatcher} >> - */ >> -org.apache.flex.jquery.Application.prototype.model =3D null; >> - >> - >> -/** >> - * @expose >> - * @type {org.apache.flex.core.SimpleValuesImpl} >> - */ >> -org.apache.flex.jquery.Application.prototype.valuesImpl =3D null; >> - >> - >> -/** >> - * @expose >> - * @this {org.apache.flex.jquery.Application} >> - */ >> -org.apache.flex.jquery.Application.prototype.start =3D function() { >> - var evt, i, n, q; >> - >> - this.element =3D document.getElementsByTagName('body')[0]; >> - >> - >>org.apache.flex.utils.MXMLDataInterpreter.generateMXMLProperties(this, >> - this.get_MXMLProperties()); >> - >> - this.dispatchEvent('initialize'); >> - >> - this.initialView.addToParent(this.element); >> - this.initialView.initUI(this.model); >> - >> - this.dispatchEvent('viewChanged'); >> -}; >> - >> >> >>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/114aeec9/frameworks >>/js/F >> lexJS/src/org/apache/flex/jquery/staticControls/RadioButton.js >> ---------------------------------------------------------------------- >> diff --git >> >>a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioBut >>ton.j >> s >> >b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButt >on.j> >s >> index 35d2371..db85bf9 100644 >> --- >> >a/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButt >on.j> >s >> +++ >> >b/frameworks/js/FlexJS/src/org/apache/flex/jquery/staticControls/RadioButt >on.j> >s >> @@ -16,39 +16,114 @@ >> goog.provide('org.apache.flex.jquery.staticControls.RadioButton'); >> >> goog.require('org.apache.flex.core.UIBase'); >> >> - >> - >> /** >> * @constructor >> * @extends {org.apache.flex.core.UIBase} >> */ >> org.apache.flex.jquery.staticControls.RadioButton =3D function() { >> + >> goog.base(this); >> + >> + org.apache.flex.core.UIBase.call(this); >> + org.apache.flex.jquery.staticControls.RadioButton.radioCounter++; >> }; >> goog.inherits(org.apache.flex.jquery.staticControls.RadioButton, >> org.apache.flex.core.UIBase); >> >> >> /** >> + * @expose >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + * The name of the radioGroup. >> + */ >> >>+org.apache.flex.jquery.staticControls.RadioButton.prototype.radioGroupNa >>me; >> + >> +/** >> + * @expose >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + * Used to provide ids to the radio buttons. >> + */ >> +org.apache.flex.jquery.staticControls.RadioButton.radioCounter =3D 0; >> + >> +/** >> + * @expose >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + * Used to manage groups on the radio buttons. >> + */ >> +org.apache.flex.jquery.staticControls.RadioButton.groups =3D { }; >> + >> +/** >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + * Flag to make sure the event handler is set only once. >> + */ >> +org.apache.flex.jquery.staticControls.RadioButton.groupHandlerSet =3D >>false; >> + >> +/** >> * @override >> * @this {org.apache.flex.jquery.staticControls.RadioButton} >> * @param {Object} p The parent element. >> */ >> >>org.apache.flex.jquery.staticControls.RadioButton.prototype.addToParent = =3D >> function(p) { >> - var rb; >> >> - this.element =3D document.createElement('label'); >> + var input =3D document.createElement('input'); >> + input.type =3D 'radio'; >> + input.name =3D 'radio'; >> + input.id =3D >> 'radio'+org.apache.flex.jquery.staticControls.RadioButton.radioCounter; >> + >> + var label =3D document.createElement('label'); >> + label.htmlFor =3D input.id; >> + >> + p.appendChild(input); >> + p.appendChild(label); >> + >> + this.element =3D input; >> + this.labelFor =3D label; >> >> - rb =3D document.createElement('input'); >> - rb.type =3D 'radio'; >> - $(rb).button(); >> - this.element.appendChild(rb); >> - this.element.appendChild(document.createTextNode('radio button')); >> + this.positioner =3D this.element; >> +}; >> >> - p.appendChild(this.element); >> +/** >> + * @override >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + * @param {Object} doc the document for this item >> + */ >> >>+org.apache.flex.jquery.staticControls.RadioButton.prototype.setDocument >>=3D >> +function(doc, id) { >> + if( ! >> org.apache.flex.jquery.staticControls.RadioButton.groupHandlerSet ) { >> + >> org.apache.flex.jquery.staticControls.RadioButton.groupHandlerSet =3D >>true; >> + >> doc.addEventListener("initComplete",goog.bind(this.initCompleteHandler, >> this)); >> + } >> +} >> >> - this.positioner =3D this.element; >> +/** >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + * @param {Event} event The event. >> + */ >> >>+org.apache.flex.jquery.staticControls.RadioButton.prototype.initComplete >>Handl >> er =3D >> +function(event) { >> + var divtags =3D >> org.apache.flex.jquery.staticControls.RadioButton.groups; >> + for(var name in divtags) >> + { >> + var div =3D divtags[name]; >> + $(div).buttonset(); >> + } >> +} >> + >> +/** >> + * @expose >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + */ >> +org.apache.flex.jquery.staticControls.RadioButton.prototype.initModel = =3D >> +function() { >> +}; >> + >> +/** >> + * @expose >> + * @this {org.apache.flex.jquery.staticControls.RadioButton} >> + */ >> +org.apache.flex.jquery.staticControls.RadioButton.prototype.initSkin = =3D >> +function() { >> }; >> >> >> @@ -57,9 +132,8 @@ >> org.apache.flex.jquery.staticControls.RadioButton.prototype.addToParent >>=3D >> * @this {org.apache.flex.jquery.staticControls.RadioButton} >> * @return {string} The groupName getter. >> */ >> >>-org.apache.flex.jquery.staticControls.RadioButton.prototype.get_groupNam >>e =3D >> - function() { >> - return this.element.childNodes.item(0).name; >> >>+org.apache.flex.jquery.staticControls.RadioButton.prototype.get_groupNam >>e =3D >> function() { >> + return this.radioGroupName; >> }; >> >> >> @@ -68,9 +142,39 @@ >> >>org.apache.flex.jquery.staticControls.RadioButton.prototype.get_groupName >> =3D >> * @this {org.apache.flex.jquery.staticControls.RadioButton} >> * @param {string} value The groupName setter. >> */ >> >>-org.apache.flex.jquery.staticControls.RadioButton.prototype.set_groupNam >>e =3D >> - function(value) { >> - this.element.childNodes.item(0).name =3D value; >> >>+org.apache.flex.jquery.staticControls.RadioButton.prototype.set_groupNam >>e =3D >> function(value) { >> + >> +/* >> + * NOTE: Ideally when a RadioButton was created it would be added to an >> existing set of RadioButtons. >> + * This is especially true for RadioButtons added dynamically. >>However, due >> to a bug in jQuery >> + * (see http://bugs.jqueryui.com/ticket/8975), it is currently not >>possible >> to add or remove RadioButtons >> + * programmatically. For this version the groups are maintained here in >> RadioButton and once the >> + * application has finished initializing, the groups are given their >> buttonset(). >> + */ >> + >> + this.radioGroupName =3D value; >> + >> + this.element.name =3D value; >> + >> + var div; >> + >> + if( >>org.apache.flex.jquery.staticControls.RadioButton.groups[value] ) >> { >> + div =3D >> org.apache.flex.jquery.staticControls.RadioButton.groups[value]; >> + div.appendChild(this.element); >> + div.appendChild(this.labelFor); >> + } >> + else { >> + var p =3D this.element.parentElement; >> + div =3D document.createElement('div'); >> + div.id =3D value; >> + div.appendChild(this.element); >> + div.appendChild(this.labelFor); >> + p.appendChild(div); >> + >> + >> org.apache.flex.jquery.staticControls.RadioButton.groups[String(value)] >>=3D div; >> + } >> + >> + this.positioner =3D div; >> }; >> >> >> @@ -79,9 +183,8 @@ >> >>org.apache.flex.jquery.staticControls.RadioButton.prototype.set_groupName >> =3D >> * @this {org.apache.flex.jquery.staticControls.RadioButton} >> * @return {string} The text getter. >> */ >> -org.apache.flex.jquery.staticControls.RadioButton.prototype.get_text = =3D >> - function() { >> - return this.element.childNodes.item(1).nodeValue; >> +org.apache.flex.jquery.staticControls.RadioButton.prototype.get_text = =3D >> function() { >> + return this.labelFor.innerHTML; >> }; >> >> >> @@ -90,9 +193,8 @@ >> org.apache.flex.jquery.staticControls.RadioButton.prototype.get_text =3D >> * @this {org.apache.flex.jquery.staticControls.RadioButton} >> * @param {string} value The text setter. >> */ >> -org.apache.flex.jquery.staticControls.RadioButton.prototype.set_text = =3D >> - function(value) { >> - this.element.childNodes.item(1).nodeValue =3D value; >> +org.apache.flex.jquery.staticControls.RadioButton.prototype.set_text = =3D >> function(value) { >> + this.labelFor.innerHTML =3D value; >> }; >> >> >> @@ -101,9 +203,8 @@ >> org.apache.flex.jquery.staticControls.RadioButton.prototype.set_text =3D >> * @this {org.apache.flex.jquery.staticControls.RadioButton} >> * @return {bool} The selected getter. >> */ >> >>-org.apache.flex.jquery.staticControls.RadioButton.prototype.get_selected >> =3D >> - function() { >> - return this.element.childNodes.item(0).checked; >> >>+org.apache.flex.jquery.staticControls.RadioButton.prototype.get_selected >> =3D >> function() { >> + return this.element.checked; >> }; >> >> >> @@ -112,7 +213,6 @@ >> >>org.apache.flex.jquery.staticControls.RadioButton.prototype.get_selected >>=3D >> * @this {org.apache.flex.jquery.staticControls.RadioButton} >> * @param {bool} value The selected setter. >> */ >> >>-org.apache.flex.jquery.staticControls.RadioButton.prototype.set_selected >> =3D >> - function(value) { >> - this.element.childNodes.item(0).checked =3D value; >> >>+org.apache.flex.jquery.staticControls.RadioButton.prototype.set_selected >> =3D >> function(value) { >> + this.element.checked =3D value; >> }; >> > >-- >Alex Harui >Flex SDK Team >Adobe Systems, Inc. >http://blogs.adobe.com/aharui >