| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| 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. |
| |
| --> |
| <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:js="library://ns.apache.org/royale/basic" |
| xmlns:j="library://ns.apache.org/royale/jewel" |
| xmlns:html="library://ns.apache.org/royale/html"> |
| |
| <fx:Script> |
| <![CDATA[ |
| private function radioChanged(event:Event):void |
| { |
| result.text = "The radio button selected has the value: " + RadioButton(event.target).value; |
| } |
| ]]> |
| </fx:Script> |
| |
| <j:initialView> |
| <j:View> |
| <j:beads> |
| <js:Paddings padding="30"/> |
| <j:VerticalLayout gap="3"/> |
| </j:beads> |
| |
| <html:H2 text="Creating a group of Jewel RadioButtons"/> |
| |
| <j:Label text="Which option do you prefer?"/> |
| |
| <j:RadioButton text="Option 1" groupName="radios" value="1" change="radioChanged(event)"/> |
| <j:RadioButton text="Option 2" groupName="radios" value="2" change="radioChanged(event)"/> |
| <j:RadioButton text="Option 3" groupName="radios" value="3" change="radioChanged(event)"> |
| <j:beads> |
| <j:Disabled id="opt3disable" disabled="false"/> |
| </j:beads> |
| </j:RadioButton> |
| |
| <j:Label id="result" text="The radio button selected has the value:"/> |
| |
| <j:Button text="disable/enable option 3" emphasis ="primary" click="opt3disable.disabled = !opt3disable.disabled"/> |
| </j:View> |
| </j:initialView> |
| |
| </j:Application> |