hi friends
Today am learned about tooltips......
Friday, May 29, 2009
Validation and error messages
hi
Today am learned about validators like…
*Changing the color of the validation error message
*Clearing a validation error
* Specifying a listener for validation
*Validating ZIP codes
*Validating strings
*Validating social security numbers
*Validating phone numbers
Wednesday, May 27, 2009
Working with validation events
Listen for validation events dispatched by the component being validated.
Flex components dispatch valid and invalid events, depending on the results of the validation and perform any additional processing on the component based on its validation result.
The event object passed to the event listener is of type Event.
Listen for validation events dispatched by validators.
All validators dispatch valid or invalid events, depending on the results of the validation. Then perform any additional processing as required by your validator.
The event object passed to the event listener is of type ValidationResultEvent.
*Explicitly handling component validation events
*Explicitly handling validators validationevents
Flex components dispatch valid and invalid events, depending on the results of the validation and perform any additional processing on the component based on its validation result.
The event object passed to the event listener is of type Event.
Listen for validation events dispatched by validators.
All validators dispatch valid or invalid events, depending on the results of the validation. Then perform any additional processing as required by your validator.
The event object passed to the event listener is of type ValidationResultEvent.
*Explicitly handling component validation events
*Explicitly handling validators validationevents
Tuesday, May 26, 2009
Validating Data
Hi..
when we using the Flex validators do not eliminate the need to perform data validation on the server, but provide a mechanism for improving performance by performing some data validation on the client side.when the user enter the data in the UIcontrols it should have some rules to the application.
we write codes in two ways
* MXML.
* ActionScrpit.
In MXML I created one simple to validate the phone number.
Code
mx:PhoneNumberValidator
id="pnV"
source="{phoneInput}"
property="text"
mx:TextInput id="phoneInput"
In above sample phone number validator is used to validate the phone number.
Text input box is used to enter the data,and the data should be less than 10 digit number.Else,it shows error in red color around the box.
when we using the Flex validators do not eliminate the need to perform data validation on the server, but provide a mechanism for improving performance by performing some data validation on the client side.when the user enter the data in the UIcontrols it should have some rules to the application.
we write codes in two ways
* MXML.
* ActionScrpit.
In MXML I created one simple to validate the phone number.
Code
mx:PhoneNumberValidator
id="pnV"
source="{phoneInput}"
property="text"
mx:TextInput id="phoneInput"
In above sample phone number validator is used to validate the phone number.
Text input box is used to enter the data,and the data should be less than 10 digit number.Else,it shows error in red color around the box.
Friday, May 22, 2009
Create a circle by using the actionscripit
Hi
Today learned about how to draw a circle or line in mxml.Normally in flex there no circle component ,if we like to create a circle there is no such components in mxml.
By using action I am draw one circle by using actionscript.
It is the example to create a circle with color.....
within the scripit u code like this
import mx.controls.Alert;
import mx.core.UIComponent;
public function circle():void
{
var newcircle:Sprite=new Sprite();
newcircle.graphics.beginFill(0x000000,1);
newcircle.graphics.drawCircle(10,10,8);
newcircle.graphics.endFill();
var d:UIComponent=new UIComponent();
this.addChild(d);
d.addChild(newcircle);
}
*import the flash.
*Create the object as newcircle.
*Begin to draw a circle.
*Draw the with xposition 10,y position10,and then Draw with radius 8.
*create a variable to get the circle as component.
*By using addchild the object.
Today learned about how to draw a circle or line in mxml.Normally in flex there no circle component ,if we like to create a circle there is no such components in mxml.
By using action I am draw one circle by using actionscript.
It is the example to create a circle with color.....
within the scripit u code like this
import mx.controls.Alert;
import mx.core.UIComponent;
public function circle():void
{
var newcircle:Sprite=new Sprite();
newcircle.graphics.beginFill(0x000000,1);
newcircle.graphics.drawCircle(10,10,8);
newcircle.graphics.endFill();
var d:UIComponent=new UIComponent();
this.addChild(d);
d.addChild(newcircle);
}
*import the flash.
*Create the object as newcircle.
*Begin to draw a circle.
*Draw the with xposition 10,y position10,and then Draw with radius 8.
*create a variable to get the circle as component.
*By using addchild the object.
Monday, May 18, 2009
Validation Error
Hi . .
Today am learned something about the Validation error .It is used to display the error messages.You can customize the look of the component and the error message associated with the error...
* If a validation error occurs, by default Flex draws a red box around the component associated with the failure.
* If the user moves the mouse pointer over the component, Flex displays the error message associated with the error.
Working with Validation Error
Subclasses of the UIComponent base class, which include the Flex user-interface components, generally handle validation failures by changing their border color and displaying an error message. When validation succeeds, components hide any existing validation error message and remove any border.
Sample code
mx:PhoneNumberValidator
id="pnV"
source="{phoneInput}"
property="text"
wrongLengthError="Please enter a 10-digit number."/> mx:TextInput id="phoneInput"
mx:TextInput id="zipCodeInput"
In the above code,I am used the controls like Textinput,to get the string.PhoneNumberValidator is used for validate the entered data in textinput.If wrongly enter the dight means it displays the error,which is given in the wronglength error.
Today am learned something about the Validation error .It is used to display the error messages.You can customize the look of the component and the error message associated with the error...
* If a validation error occurs, by default Flex draws a red box around the component associated with the failure.
* If the user moves the mouse pointer over the component, Flex displays the error message associated with the error.
Working with Validation Error
Subclasses of the UIComponent base class, which include the Flex user-interface components, generally handle validation failures by changing their border color and displaying an error message. When validation succeeds, components hide any existing validation error message and remove any border.
Sample code
mx:PhoneNumberValidator
id="pnV"
source="{phoneInput}"
property="text"
wrongLengthError="Please enter a 10-digit number."/> mx:TextInput id="phoneInput"
mx:TextInput id="zipCodeInput"
In the above code,I am used the controls like Textinput,to get the string.PhoneNumberValidator is used for validate the entered data in textinput.If wrongly enter the dight means it displays the error,which is given in the wronglength error.
Thursday, May 14, 2009
Using data binding to configure validators
You configure validators to match your application requirements.
E.g.., For a String to be considered valid, it must be at least the minimum number of characters long, and less than or equal to the maximum number of characters.
Often, you set validator properties statically, which means that they do not change as your application executes.
E.g.., StringValidator defines that the input string must be at least one character long and no longer than 10 characters
E.g.., For a String to be considered valid, it must be at least the minimum number of characters long, and less than or equal to the maximum number of characters.
Often, you set validator properties statically, which means that they do not change as your application executes.
E.g.., StringValidator defines that the input string must be at least one character long and no longer than 10 characters
Subscribe to:
Posts (Atom)