on 05-04-2010 9:23 AM
Hi all
I am currently busy with a flash island.
In the flex application i would like to use a default FLEX TREE component. For using this tree component a XMLLIST variable is needed as a dataprovider.
The flex application receives an ARRAYCOLLECTION variable from SAP.
I have build my own code to translate this ARRAYCOLLECTION variable into a XMLLIST variable.
I tested it with local testdata and it works. When i try it with data from the ABAP WEBDYNPRO the data in the ARRAYCOLLECTION is always NULL.
I had seen that when a default component of FLEX receives the data of the ARRAYCOLLECTION as dataprovider the default component is always filled with data. So it always receives data in the initial part of the FLEX program. And i can't figure out how the default components pull it off.
My first try out was creating a default TREE component in my flex application. In the application ACTIONSCRIPT was created which translated the ARRAYCOLLECTION into the XMLLIST. I thought with the APPLICATIONCOMPLETE event all the data should be in the FLEX program. So i had a listener for this EVENT in the APPLICATION tag. This listener event triggert the ACTIONSCRIPT code for the translation. But that did not work. The data in the ARRAYCOLLECTION stays NULL
My second try out was creating an own flex component and sending the initial ARRAYCOLLECTION to it. Yust like the default components of FLEX. I thought the default components receives the data on a proper way, maybe it works.
In my own component there was code which made the translation to the XMLLIST variable.
But that also did not work. The data in the ARRAYCOLLECTION stays NULL
So my question is:
How do you or where can you receive the data from SAP and work with it in ACTION SCRIPT code in the initial part of your FLEX program? If you would like to set the data of the ARRAYCOLLECTION on a differnt manner?
Kind regards
Antin Pierhagen
Instead of using a bindable ArrayCollection to connect to the WDA data, use a bindable GET function. This will allow you to fire code whenever the data is restored from the WDA side. The data pouplation from the WDA side happens asychronously and can't be assume to be complete within any of the standard Flex events (since it is pushed from outside the FlashPlayer Plug-in via JavaScript).
Use
public function set mapDataSource(val:Object):void{ }
Instead of
[Bindable]
public var mapDataSource:ArrayCollection;
Here is a tutorial that uses SET functions:
http://wiki.sdn.sap.com/wiki/display/EmTech/IslandsWDA_GMaps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>But do you also have to tell the flex or WDA that there is a SET function waiting?
Same rules as a bindable public variable - it must be mapped from the Web Dynpro side. Make sure you mappings and UI element definitions are correct on the WDA side. Have a look at the eLearning and sample code that I pointed you to earlier.
Difficult to say. I suspect that something is wrong with your binding definitions. If you have the correct number of rows then you know you are binding to the content elements correctly. I would suggest that you start with a simple context with just a single attribute with a simple data type to test your logic.
What i don't understand is that one variable is a Arraycollection which is used in a default FLEX component. During initial processing this default FLEX component is getting filled by data from this variable.
I also try to receive the data of this variable via a SET function. But when i try that. The Arraycollection only contains rows with NULL object.
So the data of the variables is loaded correctly for the default components. But with a eventlistener or a SET function it doesnt.
Can it be that the SET function is called to early? That i can manage that?
Edited by: Anton Pierhagen on May 4, 2010 5:16 PM
Edited by: Anton Pierhagen on May 4, 2010 5:17 PM
I meant the default FLEX components like a TEXTAREA or an LABEL or an COMBOBOX. Those are filled with the data of SAP
when i set the variable as dataprovider.
I have tried it without [Bindable] variables but it didn't changed anything.
Still the variables has the correct number of rows but all has NULL objects...
I have the similar problem, but i am not using any GET SET methods. It is just simple application to display Table data using FlashIslands. Rows/data is passed from WDA to Flex but they are displayed as null. If entries are more Flex displays scroll bar but the entries are not shown.
I am using Flex SDK 3.2 and all the case sensitive declaration are well taken care of.
Anybody has any idea?
Thanks in Advance!!
Anton,
Bindable table/array collection is not recognized at all in Flex. If It it is converted to string in Flex, it shows the following.
(sap.core.wd.context::WDContextNodeCollection)#0
filterFunction = (null)
length = 3
list = (mx.collections::ArrayList)#1
length = 3
source = (Array)#2
[0] (sap.core.wd.context::WDContextNode)#3
[1] (sap.core.wd.context::WDContextNode)#4
[2] (sap.core.wd.context::WDContextNode)#5
uid = "82B45BDD-6B92-7FD5-44CB-B090A9B136ED"
sort = (null)
source = (Array)#2
Please let me know if had faced this issue anytime....
Got quite a similar problem. DataSource never gets updated, neither via the equality of names, nor the getters and setters. In WDA the barchart (Thanks to Thomas Jung for this great series!) is displayed, but no data is transported. I also put in a label displaying the number of records - stays null either way.
Any help would be extremely appreciated!
Cheerio...
Lukas
SDK 4.0...
Tried to use some earlier Version, but FB4 earliest supported version is SDK 3.5. Are there any libraries by SAP to upload in order to support one of those?
Another suggestion would be using command line for compilation under 3.2, but command line is command line
Or is there any possibility to downgrade FB4 or enabling SDKs 3.2 and lower?
Thanks for any advise...
Lukas
You must use Flex SDK 3.3 or lower.
Note: A recent compatibility issue was discovered pertaining to the Flash Islands technology and the Flex SDK 3.4. There was a change in the SDK in version 3.4 that makes the current Flash Island libraries supplied by SAP unusable. The issue is being researched by SAP and Adobe. Until a solution can be determined, SAP recommends the use of the Flash Islands technology only with SDK releases less than 3.4.
The latest status on this issue will be maintained here (service marketplace logon required): https://service.sap.com/sap/support/notes/1312542
Here is the Adobe Link where you can download older versions of the SDK:
http://opensource.adobe.com/wiki/display/flexsdk/DownloadFlex3
And if you have downloaded the previous version of flex 3.3 or lower. Via the following steps you can downgrade your flex builder;
- Click via the 'right mouse button' on your project header folder
- And choose for the 'tab' Flex Compiler.
- Choose here the option 'Configure Flex SDKs....
- Now you see a window where all the SDK's stands which your Flex builder has.
- Choose 'Add'
- Choose the folder where you have unzipped your 'SDK'
- And the 'older version' will apear in your list
- Via the checkbox behind the SDK you can choose if it will be the default SDK for the flex builder. If you only use the flex builder for SAP applications it is recommended.
- Click ok
-
And if you have downloaded the previous version of flex 3.3 or lower. Via the following steps you can downgrade your flex builder;
- Click via the 'right mouse button' on your project header folder
- And choose for the 'tab' Flex Compiler.
- Choose here the option 'Configure Flex SDKs....
- Now you see a window where all the SDK's stands which your Flex builder has.
- Choose 'Add'
- Choose the folder where you have unzipped your 'SDK'
- And the 'older version' will apear in your list
- Via the checkbox behind the SDK you can choose if it will be the default SDK for the flex builder. If you only use the flex builder for SAP applications it is recommended.
- Click ok
- You are back in the 'Flex compiler' tab of the properties of your project.
- Via the pull down menu in the option fields 'Flex SDK version' you can choose for the older version, if you haven't set it as default. If it is default is should be chosen by the flex builder
And your done! Click 'ok'
Hm, got another issue while 'downgrading'. When trying to compile, FB4 tells me, the german locales would be missing. Already asked google, but the only response was to copy the english locales to a new folder and naming it as the german ones. I did that, but the error stays the same...:
"unable to open '...\SDK 3.3\frameworks\locale\de_DE'"
Any suggestions?
Thanks in advance,
Lukas
Seems to be some common problem. But can be solved (via 'workaround') quite easily:
Open 'Project - Properties - Flex Compiler' and change 'Additional Compiler Arguments' to '-locale en_US'.
Seems like the german locales just don't exist. Therefore you can just switch to the american ones.
Hope that helps at least someone...
Cheers,
Lukas
And what is the solution of problems ?? I have the same problem in Flex and use SDK 3.2.
[Bindable] public var tasks:ArrayCollection;
[Bindable] public var resourceId:String;
[Bindable] public var startTime:String;
[Bindable] public var endTime:String;
for(var i: int=0; i < tasks.length; i++)
{
mx.controls.Alert.show("Ausgabe: " + String(tasks<i>.startTime) + " " + String(tasks<i>.endTime) + " " + String(tasks<i>.resourceId));
The Array Collection is null.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.