Uniface User Forum

 View Only
  • 1.  webtrigger/weboperation and $widgetoperation

    PARTNER
    Posted 01-28-2022 11:58
    Edited by Iain Sharp 01-28-2022 12:41

    #uniface-10 #web #solved

    I have a form component with an HTML widget, designed to be a 'wrapper' for DSP content in my application. (We are trying to shift our CS to browser, but it's going to have to be hybrid from some time yet...)
    And a dsp to go with it. 

    In the DSP I have defined 

    weboperation doquit
    ;Called by wrapper quit program
    javascript
    window.unifaceTriggers("web_quit")
    endjavascript
    end​

    which shows in the dspjs/component.js file as 

    ,
    doquit:function(){
     window.unifaceTriggers("web_quit")
    }
    Which seems okay. 
    When I try to trigger this from the component using :-
    $fieldhandle(d_html)->$widgetoperation("JS:doquit")​

    With the 'inspect' function running, I can see the doquit function in the sources, but it gives the error 

    VM712:1 Uncaught ReferenceError: doquit is not defined
        at <anonymous>:1:1

    As does trying to run doquit() from the console 
    Running window.unifaceTriggers("web_quit")  from the console, correctly activate a trigger on d_html (and closes the program). 
    What have I missed in the definition of or call to doquit?
    I've tried it defined as weboperation and webtrigger. 

    Thanks
    Iain

    ​​ ​

    ------------------------------
    Iain Sharp
    Head of Technical Services
    Pci Systems Ltd
    Sheffield GB
    ------------------------------
    ​​​​


  • 2.  RE: webtrigger/weboperation and $widgetoperation
    Best Answer

    PARTNER
    Posted 01-28-2022 12:23
    Hi Iain,

    DoQuit() operation is defined in a DSP instance.

    You must try to use : $fieldhandle(d_html)->$widgetoperation("JS: uniface.getInstance('YOURDSP').activate('doquit')")

    Gilles.

    ------------------------------
    Hortion Gilles
    Agfa-Gevaert NV
    ------------------------------



  • 3.  RE: webtrigger/weboperation and $widgetoperation

    PARTNER
    Posted 01-28-2022 12:40
    That does the trick. Seems a bit long-winded, but now I know how it's a matter of adding them to the template(s) *cough* modeled components.

    ------------------------------
    Iain Sharp
    Head of Technical Services
    Pci Systems Ltd
    Sheffield GB
    ------------------------------