Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As Creynders suggested, it depends on the scope of these variables, if they are const, model, or user input.</p> <p>A great resource for me has been the ActionScript Developer's Guide to RobotLegs: <a href="http://books.google.ca/books/about/ActionScript_Developer_s_Guide_to_Robotl.html?id=PFA2TWqZdSMC&amp;redir_esc=y" rel="nofollow">http://books.google.ca/books/about/ActionScript_Developer_s_Guide_to_Robotl.html?id=PFA2TWqZdSMC&amp;redir_esc=y</a></p> <p>This is my usual workflow:</p> <ol> <li>View dispatches a custom event and passes parameters to the event.</li> <li>Mediator listens to the Event and re-dispatches it.</li> <li>Context maps the event to a command.</li> <li>Command injects the event, any necessary models, and the service.</li> <li><p>Command calls the service, passing any necessary parameters. In the example below, I am passing a variable from the LoadLicenseEvent and from the ITokenModel to the service call. I use commandMap.detain() and commandMap.release() to keep the command alive until the service call is complete. The base class ServiceModuleCommand handles the fault event.</p> <pre><code>public class LoadLicenseCommand extends ServiceModuleCommand { [Inject] public var event:LoadLicenseEvent; [Inject] public var service:ILicenseService; [Inject] public var tokenModel:ITokenModel; [Inject] public var licenseModel:ILicenseModel; public override function execute():void { commandMap.detain(this); var token:TokenVO = tokenModel.getToken(); var asyncToken:AsyncToken = service.getLicense(token.Id, event.id); asyncToken.addResponder(new mx.rpc.Responder(resultHandler, faultHandler)); } private function resultHandler(e:ResultEvent):void { var license:LicenseWebViewVO = e.result as LicenseWebViewVO; if (license) { licenseModel.license = license; dispatchToModules(new RunWidgetEvent(WidgetType.getWidgetId(WidgetType.LICENSE))); } commandMap.release(this); } </code></pre></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload