Step by Step Guide For Creating Flash Islands Using Webdynpro Java
Step by Step Guide For Creating Flash Islands Using Webdynpro Java
Applies to:
Composition Environment (CE) Enhancement Pack 1 and above.
Summary
In this article we will be looking at one of the new feature Flash islands introduced with CE Enhancement Pack for Webdynpo Java Download sample files: 1. Flex Project for using as Flash Island in Web Dynpro 2. Sample Application for using Flash Islands in Web Dynpro Author: Ayyapparaj KV
Author Bio
Ayyapparaj KV Is a Netweaver certified consultant working for Bristlecone
Step by Step Guide for creating Flash islands using Webdynpro Java
Table of Contents
What is Flash Islands?........................................................................................................................................3 Architecture.........................................................................................................................................................3 Tools to develop Rich Islands.............................................................................................................................3 Process Flow ......................................................................................................................................................4 Flex Part..........................................................................................................................................................4 In Webdynpro..................................................................................................................................................4 Creating Flex component....................................................................................................................................5 MXML Source .....................................................................................................................................................8 Creating swf file ..................................................................................................................................................9 Data Binding between Flex component and Webdynpro .................................................................................10 Steps to be carried out in Webdynpro ..............................................................................................................11 Context Structure needed for the Project .........................................................................................................11 Creating Flash Island........................................................................................................................................13 Properties of Individual components.............................................................................................................16
Flash Island................................................................................................................................................................16 Data Source ...............................................................................................................................................................16 Property .....................................................................................................................................................................16
Supplying the context with data........................................................................................................................17 Building, Deploying and Running the Project ...................................................................................................18 Result................................................................................................................................................................19 Related Content................................................................................................................................................20 Disclaimer and Liability Notice..........................................................................................................................21
Step by Step Guide for creating Flash islands using Webdynpro Java
Architecture
Step by Step Guide for creating Flash islands using Webdynpro Java
Process Flow
You can create this application by carrying out the following steps Flex Part 1) Create a Flex Project 2) Add SAP provided component as part of the library. 3) Set the compiler to respective version. 4) Create MXML file 5) Build and export it as swf In Webdynpro 1) Create a view 2) Make the root element as flash Island 3) Place the swf file in mimes folder of the project 4) Set the properties for the flash Island 5) Add Data Source as Child of Flash Island 6) Add Properties and events based on the requirement.
Step by Step Guide for creating Flash islands using Webdynpro Java
3) Right click on your Flex project in flex builder and select Properties. 4) Choose the library Path tab and click on Add SWC Button.
Step by Step Guide for creating Flash islands using Webdynpro Java
Step by Step Guide for creating Flash islands using Webdynpro Java
Step by Step Guide for creating Flash islands using Webdynpro Java
MXML Source
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" initialize="initApp()"> <mx:Script> <![CDATA[ import sap.FlashIsland; import mx.collections.ArrayCollection; [Bindable] public var dataSource:ArrayCollection; [Bindable] public var Medal:String; [Bindable] public var Count:String; public function initApp():void { FlashIsland.register(this); } private function displayGold(data:Object, field:String, index:Number, percentValue:Number):String { var temp:String= (" " + percentValue).substr(0,6); return "Total "+ data.Medal + ": " + data.Count + '\n' + temp + "%"; } ]]> </mx:Script> <mx:Panel title="PieChart Control" layout="vertical" color="0xffffff" borderAlpha="0.15" height="240" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center"> <mx:PieChart id="chart" height="100%" width="100%" paddingRight="5" paddingLeft="5" color="0x323232" showDataTips="true" dataProvider="{dataSource}" > <mx:series> <mx:PieSeries labelPosition="callout" field="Count" labelFunction="displayGold"> <mx:calloutStroke> <mx:Stroke weight="0" color="0x888888" alpha="1.0"/> </mx:calloutStroke> <mx:radialStroke> <mx:Stroke weight="0" color="#FFFFFF" alpha="0.20"/> </mx:radialStroke> <mx:stroke> <mx:Stroke color="0" alpha="0.20" weight="2"/> </mx:stroke>
Step by Step Guide for creating Flash islands using Webdynpro Java
Step by Step Guide for creating Flash islands using Webdynpro Java
Copy the .swf file and place it inside the mimes folder of webdynpro project.
Step by Step Guide for creating Flash islands using Webdynpro Java
Step by Step Guide for creating Flash islands using Webdynpro Java
Name
Data Type
Singleton
Selection Cardinality
Medals Chart Count Medal Bronze Country Gold Silver integer String Integer String Integer Integer
true False
Map the context from component controller to view controller. Using apply template create a table using the node Medals as Data Source and add all the attributes as Table Columns. Add a view container Ui element to the view. This will be the container for the Flash Island. Your screen should look as follows
Step by Step Guide for creating Flash islands using Webdynpro Java
Create new View Right click on the Root Element (Transparent Container) Select Replace With->Flash Island
Step by Step Guide for creating Flash islands using Webdynpro Java
Select Ok. When you right click on the Flash Island Element you will be able to get the following menu
Step by Step Guide for creating Flash islands using Webdynpro Java
Insert Data Source is used to assign Datasource for the flash island Insert Property is used to assign Properties for the Island. Insert Event is used to assign events to the island. Following image shows the binding of context structure available in Webdynpro and Bindable variables in Flex, this is achieved using Property, Data Source and Events
To achieve this we need to create one data source and two Properties.
Step by Step Guide for creating Flash islands using Webdynpro Java
Properties of Individual components Flash Island Connecting .swf with the Flash Island is done using the property swfFile.
Data Source If you look in the above image you will be able to see that dataSource is the name of the property defined in Flex
Property
Step by Step Guide for creating Flash islands using Webdynpro Java
Following code is used to populate the Sub Node Medal using supply function.
Step by Step Guide for creating Flash islands using Webdynpro Java
Step by Step Guide for creating Flash islands using Webdynpro Java
Result
Step by Step Guide for creating Flash islands using Webdynpro Java
Related Content
Downloads: Flex Project for using as Flash Island in Web Dynpro Sample Application for using Flash Islands in Web Dynpro For more information, visit the User Interface Technology homepage.
Step by Step Guide for creating Flash islands using Webdynpro Java