Get datas back from a modal

Home Forums Convertigo Products Get datas back from a modal

This topic contains 1 reply, has 2 voices, and was last updated by 3 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #255991

    Alexandre Perret


    I need to get datas back from a modal page into the parent page.
    Please how to do it ?
    (I used a modalAction to call a page in a modal)

    Thank you


    Gregory Vorbe

    Hello Alexandre,

    With the minimum code writing and only using available Mobile Palette components, I would suggest you use to create a ‘setGlobal’ component in your parent page like:

    Property = myModalVars
    value = {} (TS)

    on a ‘onDidEnter’ pageEvent component, for example.
    Then, in your Modal page, add a ‘CustomAction’ component as parent of a ‘CloseModal’ component (if values passes your control validation or if user clicked an ‘OK’ button, for example) and write in it: = myValue1; = myValue2;

    In your parent page you will have the fresh new data like:
    => {"myData1": myValue1,"myData2": myValue2, etc...}

    myModalVars is global for every pages.
    If you want a local variable for your page only, edit page class (right-click on the Page name) and add your variable between

    public myModalVars = {};

    When calling your modal page, set ‘Page data’ property to this.myModalVars in TS mode.
    In your modal page, populate variable using
    this.myModalVars.data1 = myValue1;


Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Convertigo Products’ is closed to new topics and replies.