Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 206069

Re: How to use NavigationRequest targetProperties?

$
0
0

A global view does not use a context, only object views have the notion of object context, i.e. the currently selected object in the navigator (their mediators implement IContextObjectHolder).


NavigationRequest.targetProperties can be used to pass a bag of properties to the target extension.

For instance in globalview-ui SettingViewMediator change onLinkButtonClick to this:

 

 

   private function onLinkButtonClick(click:MouseEvent):void {
      // Jump to the main App view
      var event:NavigationRequest = new NavigationRequest();
      event.targetViewUid = APPVIEW_ID;
      // Optionnaly you can pass a bag of properties to set on the target extension object.
      event.targetProperties = new Dictionary();
      event.targetProperties["settings"] = _view.setting1.text + ", " + _view.setting2.text + ", " + _view.setting3.text;
      dispatchEvent(event);
   }

 

and in MainView.xml  add the settings property that will get set during the NavigationRequest:

 

  <mx:Script>

      <![CDATA[

         import com.vmware.samples.globalview.Util;

         import mx.controls.Alert;

 

         /**

          * The settings property is set by the NavigationRequest in SettingViewMediator,

          * this is an example of passing data between two views.

          */

         public function set settings(value:String):void {

            // Simple debug message

            Alert.show("Navigating from Settings view, current values are: " + value);

            _settings = value;

         }

         private var _settings:String;


Viewing all articles
Browse latest Browse all 206069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>