BPM, Workflow, and Case

  • 1.  Binding data from view

    Posted Sat September 18, 2021 11:51 AM
    Good evening community I hope you are well,



    The Error :


    Please I try to get and set data as explained on the images but I always have the following error:  Uncaught TypeError: this.context.binding is undefined

    can someone help me please

    Thx.

    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------


  • 2.  RE: Binding data from view

    Posted Mon September 20, 2021 02:05 AM
    You probably did not bind the "findUserByName" coach view with a variable (in the coach).
    You can also write more defensive code so you avoid null pointer errors e.g.:

    this.findUser = function () {
       var binding =  this.context.binding && this.context.binding.get('value') || {};
       console.log('username', binding.username);
    }

    ------------------------------
    ZAFIRIS KERAMIDAS
    ------------------------------



  • 3.  RE: Binding data from view

    Posted Mon September 20, 2021 04:25 AM
    Hi Mrs Zafiris

    Thank you for your time, unfortunately it doesn't work I still have undefined



    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------



  • 4.  RE: Binding data from view

    Posted Mon September 20, 2021 05:27 AM
    Edited by Atanu Roy Mon September 20, 2021 07:20 AM


  • 5.  RE: Binding data from view

    Posted Mon September 20, 2021 07:05 AM
    Hi Atanu. No, you are not right. "this" is accessible fine inside the function...

    ------------------------------
    ZAFIRIS KERAMIDAS
    ------------------------------



  • 6.  RE: Binding data from view

    Posted Mon September 20, 2021 07:19 AM
    @ZAFIRIS KERAMIDAS Yes, you are right, "this" should be accessible.

    @El Mehdi ES-SAFI, you might be missing the variable mapping with the coach view from coach and possibly the variable is not initialized.​​​​

    ------------------------------
    Atanu Roy
    Solution Architect
    Salient Process
    ------------------------------



  • 7.  RE: Binding data from view

    Posted Mon September 20, 2021 07:12 AM
    Hello Roy,
    I did as you said but I always had the undefind problem

    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------



  • 8.  RE: Binding data from view

    Posted Mon September 20, 2021 07:03 AM
    Did you confirm that you have a variable bound to the coach view (in the coach)?

    (the code is working because I see that you are not getting an error now)

    ------------------------------
    ZAFIRIS KERAMIDAS
    ------------------------------



  • 9.  RE: Binding data from view

    Posted Mon September 20, 2021 07:15 AM
    Hi Zafiris

    I share with you the variables I have on this view



    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------