blob: 162970d79c8cc20465176ddd7a785692c691b59b [file] [log] [blame]
<?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.
-->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:sv="spark.validators.*"
updateComplete="init()"
minWidth="955" minHeight="600">
<fx:Declarations>
<sv:CurrencyValidator id="gvb"/>
<sv:CurrencyValidator id="gvbInline" trigger="{myTI2}"/>
<sv:CurrencyValidator id="gvbInline1" source="{myTI1}" property="text"/>
<sv:CurrencyValidator id="gvbInline2" source="{myTI2}" property="text" trigger="{myTA}" required="true"/>
<sv:CurrencyValidator id="gvbInline3" trigger="{myTI3}"/>
<sv:CurrencyValidator id="gvbInline4" source="{myTI5}" property="text" triggerEvent="updateComplete"/>
<sv:CurrencyValidator id="gvbNull" trigger="{null}"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.validators.CurrencyValidator;
import mx.validators.Validator;
import spark.validators.CurrencyValidator;
public var gvbScript:spark.validators.CurrencyValidator=new spark.validators.CurrencyValidator();
public var gvbScript1:spark.validators.CurrencyValidator=new spark.validators.CurrencyValidator();
public var gvbScript2:spark.validators.CurrencyValidator=new spark.validators.CurrencyValidator();
public var mxValidator:Validator=new Validator;
[Bindable]
public var gvbScriptBinding:spark.validators.CurrencyValidator=new spark.validators.CurrencyValidator();
protected function init():void
{
this.addStyleClient(gvbScript);
this.addStyleClient(gvbScript1);
this.addStyleClient(gvbScript2);
}
public function setVtrigger(obj:*, value:*):String
{
var vError:String='No_Error';
try{
obj.trigger=value;
}catch(e:Error){
vError = e.toString();
}
return vError;
}
public function creCV(obj:*, source:*, property:*, listener:*, trigger:*, triggerEvent:*):void
{
/* obj=new spark.validators.CurrencyValidator(); */
obj=new spark.validators.CurrencyValidator();
this.addStyleClient(obj);
if(source)
obj.source=source;
if(property)
obj.property=property;
if(listener)
obj.listener=listener;
if(trigger)
obj.trigger=trigger;
if(triggerEvent)
obj.triggerEvent=triggerEvent;
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<mx:TextInput id="myTI1"/>
<mx:TextInput id="myTI2"/>
<mx:TextInput id="myTI3"/>
<mx:TextInput id="myTI4"/>
<mx:TextInput id="myTI5"/>
<mx:TextInput id="myTI6"/>
<mx:TextArea id="myTA" />
</s:Application>