Navigating the screens

Top  Previous  Next

The 'actions' property


The 'actions' property encloses a set functions with names that can be used as parameters of navigate and go methods.




'actions': {

  'main': function(hs) { = "01";



  'logout': function(hs) {





In the example shown above, the 'main' action has associated a function that takes the application HostSurfer instance as parameter and executes the following methods:


Sets '' to "01", as if the user would have typed "01" in the menu option field in the terminal emulator screen.
Sends an "ENTER" key, as if the user would accepted the selected option.


NOTE: The 'option' field is retrieved from the 'data' property of the HostSurfer instance because it was explicitly defined in the 'fields' property of the corresponding rule, as shown in the following code snippet:


'fields': [

   { ... },

   { 'name': 'option', 'row': 18, 'col': 63, 'len': 2 },

   { ... }



Actions can be chained with a single "navigate" call.