Applying properties to a Screen Rule

Top  Previous  Next

The 'apply' Property


Once a host screen was identified, HostSurfer is ready to apply the associated rule definitions. This property is used with two meanings:


To declare user fields
To define the rendering template
To provide a handler that can take action upon rule selection
To provide complex actions defined for the recognized screen.


Property name



An array of objects that identifies each user-defined field mapped to the underlying host screen, implementing two-way data binding. Please refer to 'fields' Property for details.


It defines the HTML view for the underlying screen. This property supports two different sets of values, which is determined by the framework used to render the view. Please refer to 'render' property for details.


A function that gets executed when the rule is selected. Please refer to 'handler' property for details.


A list of actions that can be used from the resulting web page. Please refer to 'actions' property for details.



The following code snippet is a simple example of 'apply' property declaration:


apply: {

   fields: [

       { name: 'screenTitle', row : 1, col : 35, len : 30},

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


   render: {

 view:  {

    template: '<h3>{{}} {{}}</h3>';



   handler: function (hs) {

         alert('Accounts last update: ';


   actions : {

       main: function(hs) {

  = "01";



       logout: function(hs) {






Additionally, in the context of a z/Scope Anywhere environment:

To declare HostSurfer applications.


Property name



An Javascript object array that declare one or more HostSurfer applications or web-widgets. Please refer to 'applications' for details.