cancel
Showing results for 
Search instead for 
Did you mean: 

flash islands Arraycollection in the flex application stay null

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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

Former Member
0 Kudos

Hi

Thank you very much for your answer. But do you also have to tell the flex or WDA that there is a SET function waiting? Because i have made one, but it won't be started when i try my flash island

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>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.

Former Member
0 Kudos

Hi

That's all done. The setter methods responds after a while. So tha'ts working. The only thing what still is not working is that i receive the arraycollection with data from SAP with the correct number of rows.

But all rows contains NULL objects. What could go wrong?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.

Former Member
0 Kudos

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

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can't have both a PUBLIC BINDABLE variable and a public SET function for the same object.

>So the data of the variables is loaded correctly for the default components.

By default components do you mean the PUBLIC BINDABLE variables?

Former Member
0 Kudos

ok... that could solve the issue.. No components like a LABEL, TEXTAREA and so on

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>No components like a LABEL, TEXTAREA and so on

I'm really confused. What do you mean here?

Former Member
0 Kudos

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...

Former Member
0 Kudos

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!!

Former Member
0 Kudos

are the name of the properties within your context mapping within your FLEX view correct?

Former Member
0 Kudos

It is for the Table so name of DataSource is same in both.

Former Member
0 Kudos

Also the DATA FIELD Names exactly match with the Context Attribute names...

Former Member
0 Kudos

do you pu them in default flex objects or do you want to initial change them in actionscript code?

Former Member
0 Kudos

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....

Former Member
0 Kudos

It was just put them in default Flex Bindable object..

Former Member
0 Kudos

Which flex version do you use?

Former Member
0 Kudos

I am using Flex SDK 3.2.

Former Member
0 Kudos

i haven't faced this kind of error before. In what kind of flex element do you use this data?

And are you sure that before at the SAP side the variables are filled with data?

Former Member
0 Kudos

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

Former Member
0 Kudos

Which version of flex do you use?

Edited by: Anton Pierhagen on Jul 5, 2010 2:26 PM

Former Member
0 Kudos

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

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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

Former Member
0 Kudos

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

-

Former Member
0 Kudos

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'

Former Member
0 Kudos

Thank you so much!

I really appreciate your effort - it was exactly what I was looking for.

Kind regards,

Lukas

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Mika

No i am sorry. I always work with the english version, so i don't know that one. Maybe there is an german SDK of 3.3. ? or the version is also downloadable from Adobe?

Former Member
0 Kudos

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

Former Member
0 Kudos

Yes indeed! I hope for you it works!!!

Former Member
0 Kudos

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.

Answers (0)