Thursday, September 20, 2007

Data binding in Flex.

About data binding

Data binding is the process of tying the data in one object to another object. It provides a convenient way to pass data around in an application. Adobe Flex 2 provides three ways to specify data binding: the curly braces ({}) syntax and the <mx:binding> tag in MXML and the BindingUtils methods in ActionScript. </mx:binding>

Common uses of data binding include the following:

  • To bind properties of user interface controls to data service requests.
  • To bind data service results to properties of user interface controls.
  • To bind data service results to a middle-tier data model, and to bind that data model's fields to user interface controls. For more information about data models, see Storing Data.
  • To bind properties of user interface controls to a middle-tier data model, and to bind that data model's fields bound to a data service request (a three-tier system).
  • To bind an ArrayCollection or XMLListCollection object to the dataProvider property of a List-based control.
  • To bind individual parts of complex properties to properties of user interface controls. An example would be a master-detail scenario in which clicking an item in a List control displays data in several other controls.
  • To bind XML data to user interface controls by using ECMAScript for XML (E4X) expressions in binding expressions.

Although binding is a powerful mechanism, it is not appropriate for all situations. For example, for a complex user interface in which individual pieces must be updated based on strict timing, it would be preferable to use a method that assigns properties in order. Also, binding executes every time a property changes, so it is not the best solution when you want changes to be noticed only some of the time.

Data binding requires a source property, a destination property, and a triggering event that indicates when to copy the data from the source to the destination. The following example shows a Text control that gets its data from an HSlider control's value property. The property name inside the curly braces is the source property of the binding expression. When the value of the source property changes, Flex copies the current value of the source property, mySlider.value, to the destination property, the Text control's text property.

You can use all properties of a component as the destination of a data binding expression. However, to use a property as the source of a data binding expression, the component must be implemented to support data binding, which means that the component dispatches an event when the value of the property changes to trigger the binding. For more information on creating component properties that can be used as the source of a data binding expression, see Bindable metadata tag in Creating and Extending Flex 2 Components.

In the Adobe Flex 2 Language Reference, a property that can be used as the source of a data binding expression includes the following statement in its description:

"This property can be used as the source for data binding."

Binding occurs under the following circumstances:

  • The object that is the binding source dispatches an event.
  • Application code calls a service.

In addition to properties, you can use ActionScript functions as the source of binding expressions. You usually do this when using a bindable property as an argument of a function. When the property changes, the function executes, and the result is used in the binding destination.

You can also use a property of type Function as a binding source or destination. A property of type Function is a variable that holds a reference to a function.

Source: http://livedocs.macromedia.com/flex/201/html/databinding_091_02.html

Sunday, September 9, 2007

The Idea and Purpose of this Blog

Hello there,
Thanks for visiting this Blog.

I am a self trained Software Developer passionate about Programming and working on solutions to Problems involving complex R&D activities.

I work on LAMP platform with AJAX, JSON using Object oriented concepts to provide faster, better, secure and feature rich web applications, solutions and services.

For those who don't know what LAMP and AJAX is, here is a quick introduction.

LAMP stands for Linux, Apache, MySQL and PHP all of which are open source technologies therefore very suitable for small organizations. As the only resources needed is the development and hosting of the application. Generally, This combination of Techniques can solve all your the computing, automation and communication needs.

AJAX stands for Asynchronous JavaScript and XML.
This allows you to Communicate between a Web browser and the Server in the background and change the content of the page, or take actions in the server.

Web 2.0 generation web Applications are achieved through AJAX.

Gmail is one such Application which uses AJAX extensively to provide services for all kind of users.

So here is a Blog dedicated to LAMP AJAX generally Web Development using this Platform and related stuff.

Basically I am looking at a Place where I can manage my Knowledge. Knowledge Management. Where I can share my Experience, Knowledge and expertise.

Keep checking out the Blog for interesting and helpful articles here or simply subscribe to the RSS Feed by clicking here