(Beta)
Package | com.adobe.mosaic.om.interfaces |
Interface | public interface IContext |
Language Version: | ActionScript 3.0 |
Product Version: | Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 9.5 |
Runtime Versions: | AIR 2.0.2, Flash Player 10.1 |
IContext
interface models a simple hash map that allows tiles to store attibutes
in name-value pairs. The name-value pairs are uniquely identified by their names, and any tile can
reference a name-value pair using the unique identifier.
The context is specific to its accessor. For example, the mosaicApp.context is shared for the application, whereas the mosaicApp.parentView.context is shared for only the specific view.
Public Methods
Method | Defined By |
---|
Method Detail
Examples How to use this example
IContext_example.mxml
<?xml version="1.0" encoding="utf-8"?> <mc:Tile xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mc="com.adobe.mosaic.core.*" xmlns:comps="*" layout="absolute" width="100%" height="100%" applicationComplete="{setMyAttributeValue();getMyAttributeValue()}"> <fx:Script> <![CDATA[ import com.adobe.mosaic.om.interfaces.IContext; private const M_STR_MY_ATTRIBUTE_NAME:String = "MyAttribute"; // Set the value of an application context variable private function setMyAttributeValue():void { var appContext:IContext = this.mosaicApp.context; appContext.setAttribute(M_STR_MY_ATTRIBUTE_NAME, "My attribute value"); } // setMyAttributeValue // Get the value of an application context variable private function getMyAttributeValue():void { var appContext:IContext = this.mosaicApp.context; var strMyAttributeValue:String = appContext.getAttribute(M_STR_MY_ATTRIBUTE_NAME); labelAttributeValue.text = strMyAttributeValue; } ]]> </fx:Script> <s:Label id="labelAttributeValue" text=""/> </mc:Tile>
Wed Nov 21 2018, 06:34 AM -08:00