Page Action

From MSX - Wiki
Revision as of 12:09, 15 January 2021 by Benzac (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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. 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]