assets/jewel/jewel_textinput/jewel_textinput.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 changeHandler(event:Event):void {
label.text = "New text is: " + event.target.text;
}
]]>
</fx:Script>
<j:initialView>
<j:View style="padding: 10px;">
<j:beads>
<j:VerticalLayout gap="8"/>
</j:beads>
<j:Label text="Jewel TextInput (change handler attached)"/>
<j:HGroup gap="3" itemsVerticalAlign="itemsCentered">
<j:TextInput change="changeHandler(event)"/>
<j:Label localId="label" text="New text is:"/>
</j:HGroup>
<j:Label text="Jewel TextInput using some beads"/>
<j:HGroup gap="3">
<j:TextInput text="Disabled with text...">
<j:beads>
<j:TextPrompt prompt="Disabled TextInput..."/>
<j:Disabled/>
</j:beads>
</j:TextInput>
<j:TextInput>
<js:beads>
<j:TextPrompt prompt="Only characters"/>
<j:Restrict pattern="[^a-zA-Z]"/>
</js:beads>
</j:TextInput>
</j:HGroup>
</j:View>
</j:initialView>
</j:Application>