SImage

Introduction
The sImage OSF Widget is used to place images on the canvas.

The first thing an sImage component checks when it is created is whether something has been defined for its  property and that no   have been defined. If something has been defined for this variable, it means that the developer wants to directly specify the location of the image to display. In such a case, the sImage component considers that this OSF Widget is not required in the layout. (See the (Require section of the sHBox page for more information about the require property of a OSF Widget.)

The reason why the  of a sImage will only be used directly if no   are defined is simple. If the sImage is part of an  that get recycled when a list scroll, then the   that was empty is not empty anymore when it gets recycled. Since there were, the control won't remove itself. If this rule won't be in place, then it means that the images would be repeated one after the other, in a loop, when the list would get scrolled.

If something has been defined for the  property, the control tries to find a bound attribute within the value of this property. If a bound(s) attribute(s) has been defined within the value of the, but that no value for these attributes have been found in the target record description, the sImage removes itself from the application layout.

If the  variable is null/empty, or if no bound attribute has been defined in the text of the component, the component then checks to see if   have been specified. If no such  have been defined, the sImage component removes itself from the application layout.

Bound Attribute
If an sImage is defined in a MXML file, developers can directly bind a record's description attributes to it (instead of using the  parameter). A special markup has been introduced in the OSF Widgets Library to give the possibility to bind an attribute value to a particular semantic control, directly in MXML.

The markup that has been introduced uses double brackets with the name of the attribute to bind in the middle, such as:

"foaf_thumnail"

For the sImage OSF Widget, variables can be bound within the  property of the sImage component. A bound variable can be the only value of the  property, or it can be part of a complete string.

Here is an example of a bound attribute to an sImage component that is used without any other character:

MXML Usage Examples
In this example, we assume that the  variable is a , where the record description is defined, accessible at the creation time of the sImage.

Related Libraries
No related external libraries.