assets/jewel/jewel_radiobutton/jewel_radiobutton.mxml (5 lines of code) (raw):

<?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:j="library://ns.apache.org/royale/jewel" xmlns:html="library://ns.apache.org/royale/html"> <fx:Script> <![CDATA[ import org.apache.royale.jewel.Alert; private function clickHandler(event:MouseEvent):void { Alert.show('RadioButton value is: ' + event.target.value , 'RadioButton value.'); } private function changeHandler(event:Event):void { Alert.show('RadioButton selected is: ' + event.target.text , 'RadioButton selected.'); } ]]> </fx:Script> <j:initialView> <j:View style="padding: 10px;"> <j:beads> <j:VerticalLayout gap="3"/> </j:beads> <j:Label text="Jewel RadioButton Group (click handler attached)"/> <j:HGroup gap="3"> <j:RadioButton text="RadioButton (click) 1" groupName="radios-click" value="Test Click 1" click="clickHandler(event)"/> <j:RadioButton text="RadioButton (click) 2" groupName="radios-click" value="Test Click 2" click="clickHandler(event)"/> <j:RadioButton text="RadioButton (click) 3" groupName="radios-click" value="Test Click 3" click="clickHandler(event)"/> </j:HGroup> <j:Label text="Jewel RadioButton Group (change handler attached)"/> <j:HGroup gap="3"> <j:RadioButton text="RadioButton (change) 1" groupName="radios-change" value="Test Change 1" change="changeHandler(event)"/> <j:RadioButton text="RadioButton (change) 2" groupName="radios-change" value="Test Change 2" change="changeHandler(event)"/> <j:RadioButton text="RadioButton (change) 3" groupName="radios-change" value="Test Change 3" change="changeHandler(event)"/> </j:HGroup> <j:Label text="Jewel RadioButton with disabled beads"/> <j:RadioButton text="Disabled"> <j:beads> <j:Disabled/> </j:beads> </j:RadioButton> <j:RadioButton text="Set and Disabled" selected="true"> <j:beads> <j:Disabled/> </j:beads> </j:RadioButton> </j:View> </j:initialView> </j:Application>