2016-11-15 40 views
0

參考:External Object for Android with callback Event爲Android外部對象有回調事件發送值

如何發送參數和GX收到?

Class.java

mCoordinator.setValue('parametro1', 'valor1'); //Is this possible? mCoordinator.setValue('parametro2', 'valor2'); mCoordinator.runAction("myEvent", null);

GX

Event UC.myevent Composite parametro1 = &sdt.parametro1 EndComposite EndEvent

感謝

+0

請澄清一下你的問題,並提供一個更好的例子,你想要什麼樣的存檔,tks。 – fpanizza

回答

2

如果您嘗試將參數發送到動作事件。你發送他們在一個上下文實體。

取決於你的背景是什麼,但例如,你需要得到實體,設置你的價值觀和發送到事件的背景下,這樣的:

Entity contextEntity = myActivity.getMainFragment().getContextEntity(); 
contextEntity.setProperty(name, value); 
mCoordinator.runAction("myEvent", null); 

或paramters發送明確地與:

Entity contextEntity = myActivity.getMainFragment().getContextEntity(); 
contextEntity.setProperty(name, value); 
myActivity.getController().runAction(myActivity.getUIContext(), actionDefinition, contextEntity);