Difference between revisions of "Page Action"

From MSX - Wiki
Jump to navigation Jump to search
(Created page with "It is possible to execute an action if a content page becomes active by setting an <code>action</code> property (of type <code>string</code>) to a content page object. An acti...")
 
Line 1: Line 1:
It is possible to execute an action if a content page becomes active by setting an <code>action</code> property (of type <code>string</code>) to a content page object. An action-related <code>data</code> property (of type <code>object</code>) can also be set. This feature is available since version '''0.1.112'''.
+
It is possible to execute an action if a content page becomes active by setting an <code>action</code> property (of type <code>string</code>) to a content page object. An action-related <code>data</code> property (of type <code>object</code>) can also be set. Please see [[Internal Actions]] for possible values. This feature is available since version '''0.1.112'''.
  
 
'''Note: A page action is executed before a selection action (which is executed if a content item becomes the focus). If the content page is displayed as overlay page, the action is executed when the entire content becomes active and it is executed before a common page action. If the content page is displayed as underlay page, the action is executed when the entire content becomes visible and it is executed before an overlay page action.'''
 
'''Note: A page action is executed before a selection action (which is executed if a content item becomes the focus). If the content page is displayed as overlay page, the action is executed when the entire content becomes active and it is executed before a common page action. If the content page is displayed as underlay page, the action is executed when the entire content becomes visible and it is executed before an overlay page action.'''

Revision as of 14:37, 15 January 2021

It is possible to execute an action if a content page becomes active by setting an action property (of type string) to a content page object. An action-related data property (of type object) can also be set. Please see Internal Actions for possible values. This feature is available since version 0.1.112.

Note: A page action is executed before a selection action (which is executed if a content item becomes the focus). If the content page is displayed as overlay page, the action is executed when the entire content becomes active and it is executed before a common page action. If the content page is displayed as underlay page, the action is executed when the entire content becomes visible and it is executed before an overlay page action.

Please see following example.

Example[edit]

Screenshot[edit]

Example Screenshot (Page Action)

Code[edit]

{
    "type": "pages",
    "headline": "Page Action",    
    "underlay": {
        "action": "logger:debug:Content is visible."
    },
    "overlay": {
        "action": "logger:debug:Content is active."
    },
    "pages": [{
            "action": "info:Page 1 is active.",
            "items": [{
                    "layout": "0,0,12,6",
                    "color": "msx-glass",
                    "headline": "Page 1"
                }]
        }, {
            "action": "info:Page 2 is active.",
            "items": [{
                    "layout": "0,0,12,6",
                    "color": "msx-glass",
                    "headline": "Page 2"
                }]
        }, {
            "action": "info:Page 3 is active.",
            "items": [{
                    "layout": "0,0,12,6",
                    "color": "msx-glass",
                    "headline": "Page 3"
                }]
        }]
}

Demo[edit]