locked
Pass Parameter to Popup HTML RRS feed

  • Question

  • I am using the html client

    I have a simple time logging app with 2 large buttons, Clock In and Clock Out. Selecting either button opens a list of employees (popup). The employee clicks their name and it saves the time and whether clocking in or out.

    Depending on which button the user presses, it will record either In or Out and the time. I have it all working apart from knowing which button opened the popup.

    How do I either pass a parameter to the popup or know which button opened the popup ?

    Regards

    Steve

    Sunday, March 16, 2014 10:41 PM

Answers

  • You are correct that screen.showPopup() doesn't take parameters.  But in the execute methods for your two Clock In and Clock Out buttons, you can try Yannick Smits suggestion and assign a local property to indicate what button was pressed, which can then be displayed in the popup or used in conditional logic for the popup.

    • Marked as answer by Angie Xu Monday, March 24, 2014 1:36 AM
    Monday, March 17, 2014 3:41 PM

All replies

  • You can add a parameter to the screen by going to "Add Data Item" and then "Add local property". In the buttons execute event you can then add the parameter to the call that opens the screen:
    myapp.showScreenName("parametervalue");



    IT Architect www.Goyaweb.nl The Hague, The Netherlands

    Monday, March 17, 2014 9:22 AM
  • Thanks for the reply. 

    I am not opening another screen just a popup from the same screen

    I am using screen.showPopup(); but can't pass a parameter

    Monday, March 17, 2014 12:43 PM
  • You are correct that screen.showPopup() doesn't take parameters.  But in the execute methods for your two Clock In and Clock Out buttons, you can try Yannick Smits suggestion and assign a local property to indicate what button was pressed, which can then be displayed in the popup or used in conditional logic for the popup.

    • Marked as answer by Angie Xu Monday, March 24, 2014 1:36 AM
    Monday, March 17, 2014 3:41 PM
  • you can use 

    myapp.showPopup("parameter");

    Your modal popup is just a screen.


    IT Architect www.Goyaweb.nl The Hague, The Netherlands

    Monday, March 17, 2014 4:51 PM