cancel
Showing results for 
Search instead for 
Did you mean: 

How to transport parameters in FlashIsland.fireEvent

Former Member
0 Kudos

Hi guys,

I am using flahsisland to explore our BW charts. I have problem when using FlashIsland.fireEvent

Read the thread by Thomas, seems the parameters can be carried out using this way : FlashIsland.fireEvent(this, 'updateData', ). But when in Web dynpro, I tried get the parameter in two ways, both are failed:

1) Add a event parameter with the same name "biView", but biView can not get the corresponding value. FAILED

public void onActionCloseWin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String biView )

{

//@@begin onActionCloseWin(ServerEvent)

if (biView == "PrintVersionDetail") {

wdContext.nodeLayout().currentLayoutElement().setPrintVersionDetail(false);

}else if (biView == "SalesDetailView"){

wdContext.nodeLayout().currentLayoutElement().setSalesDetailView(false);

}else if (biView == "StockOverview"){

wdContext.nodeLayout().currentLayoutElement().setStockOverview(false);

}else if (biView == "RemunerationDetail"){

wdContext.nodeLayout().currentLayoutElement().setRemunerationDetail(false);

}

wdContext.nodeMaterial().currentMaterialElement().setBzbm(wdEvent.getString("biView"));

//@@end

}

2) Using wdEvent.getString("biView"), seems also can not get the value.

Although here is for ABAP, but I have no choice because ABAP is more lively thant JAVA about the FlashIsland. And I also think the mechanism is the same. So, anybody can tell me how can I transport event parameters?

Thank you in advance!

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In the layout of the WD View, did you define a GACEventParameter as a child element of the GACEvent? Only defined event parameters will be parsed out of the incomming xBCML.

Otherwise what you are doing would seem correct for retrieveing the event parameters. I have Wed Dynpro ABAP applications that do the same thing. It is slightly different in WDA as we would call WDEVENT->GET_STRING( "biView" ). The event parameters are case sensitive in ABAP so I would assume the same in WDJ. If you have the elements defined right, then perhaps there is a bug in the WDJ framework as this same approach works in WDA.

Former Member
0 Kudos

Thanks Thomas. I just do not notice that I can create parameter node under event node:-). You are my hero.

Another confirmation about the mechanism of the Flashisland.fireEvent:

If I invoke the Flashisland.fireEvent in the application's creationComplete event, then the Flashisland.fireEvent will not work.

Example:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

creationComplete="onCreationComplete()" >

private function onCreationComplete():void{

FlashIsland.fireEvent(this, 'updateData', {biView:name});

}

</mx:Application>

I have tested the above example, the "fireEvent" doesn't work, it just like not fired. But if you invoke in a button event, it works OK. Is it a bug of FlashIsland?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

My guess is that creation complete is too early. The initialization of the flashIslands framework may not be complete. I'm curious about the use case. Why fire an event so early in processing?

Former Member
0 Kudos

Hi Thomas,

I have created a desktop-like FLEX application. Every window contains a BI chart. The window can be moved, or re-sized just like Microsoft windows. One button is created for saving the layout which means end-user can config the window size and position as they like. Then they save the layout information to the FLASH cookie. The next time, end-user open the FLEX application, it will initailly open the BI charts they saved last time.

One thing I should do is let the FLEX inform the WD which BI charts are opening, so I can only call the opened BI charts' Web Service, not all the Web service, Just for the performance reason. The layout information is saved in the FLEX side, I should initially let the WD know the information. Seems it is impossible, I have tested all the events and their sequence. Maybe the only way is to save the layout information in WD side.

But the use of FLASH cookie is more simple, and indeed very useful in certain senario. If WD can use it, much better.

Vincent.

kkram
Contributor
0 Kudos

In Flex, as you may already have realized, everything is asynchronous. That is why you can never be sure if the Flash island registration is complete before creationcomplete, even if you triggered the register during the initialize event.

One round about way to achieve your requirement is to create a set function and map it to the GACDatasource and a WD context. This function will get triggered once the flash registration is complete (and every time the context changes). Within this set function, you can trigger your event back to the WD to call your webservice etc.

While all this happening, you can use the cursor manager to display a wait cursor in your flex application as per the below link

http://livedocs.adobe.com/flex/3/html/help.html?content=cursormgr_3.html

KK

Former Member
0 Kudos

Thanks Krishnakumar Ramamoorthy.

This is a good way to initially transfer data btw WD and FLEX. But it can't solve my problem. The FlashIsland get registratd after wdDoInit(), which means it is not enough to just transfer data, but also the eventhandler method.

I am not sure if there is way that allow us to invoke a WD eventhandler just before the WD-FLEX application show.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I was going to sugges the same as KK - using a SET function to know when the initialization is complete and dats is ready to be received from the Web Dynpro side.

>. Seems it is impossible, I have tested all the events and their sequence. Maybe the only way is to save the layout information in WD side

Some of the rules we use internally at SAP and go into the design of FlashIslands: The Flex Component should contain no business logic or data. It should be a dummy, black box UI element. All data should flow from the Web Dynpro side and be persisted within Web Dynpro.

If you design were altered to meet these SAP standards, then your layoutting information should be saved in Web Dynpro Personalization on the server side and be pushed to the Flex Component.

Answers (0)