• Dave Wakeman
    May 25, 2016 at 2:54 pm #1913



    I created my own coach view, called VirtualAgent, which is a combination of some SPARK controls, custom HTML and some inline javascript.  I have a function I have exposed in the javascript that I am calling from an event handler from a SPARK text control.   I then took the next step and followed the steps in your Creating Your Own Control article that sets my coach view up to register itself, and I have implemented an API method on it.  That method basically just calls my function in my inline javascript, but it enables me to expose that function on my VirtualAgent coach view so that I can call it from other controls on the same coach that are not inside my coach view.


     That all works great, so I went to apply it to the POC process app I am working on and alas, there is the issue.  They have put my VirtualAgent coach view inside another coach view, “Case Template”.  Then they created another coach view, let’s call it CV1, and another one called CV2.


     Here is the issue.  In my case CV1 and VirtualAgent are both inside of Case Template.  CV2 is inside of CV1.  I want to call my function from a SPARK control inside CV2 (On Change event on a Single Select SPARK control).  Somehow, I need to write some javascript in the event handler that can traverse up to CV1, then up to Case Template in order to get to VirtualAgent.


    How do I do that?  I tried page.ui.get(…) but I get an error in the browser console that page.ui.get is undefined, so I assume I can’t use it from an event handler.



    SPARK Support
    May 25, 2016 at 3:12 pm #1915

    Hey Dave,

    You can use the me.ui.invoke(“Function_Name”, Input_data) to call functions defined in parent CVs. So within your event handler, use the invoke method to call the function.

    Here is an article look at – http://support.salientprocess.com/docs/enterprise/bpmext.ui.View.html#invoke

    -Elliot P.

    Dave Wakeman
    May 25, 2016 at 5:17 pm #1916

    Well, that’s not quite the case.  The function I want to call is exposed on a peer of the parent.  I tried this, but since it wasn’t in the direct ancestor chain it failed.

    Here’s the hierarchy, with a coach that has Case Template on it, which has a Content Box in it.  It looks sort of like this:

    Case Template (this is the top coach view on the coach)

    – Virtual Agent  (has an “update” method exposed on it)

    – Case Intake View (this is inside of a Content Box on the Case Template coach view)

    – Case Details View

    – My Single Select control.  In the On Change event handler I need to execute that update method in Virtual Agent.

    So really I need to traverse up to my coach view’s parent (Case Intake View) and then invoke a method on Virtual Agent (a sibling of Case Intake View).

    Is there a way to do that?

    May 26, 2016 at 4:16 am #1917


    Here is a twx that does what I think you want.  Text control in a coach view nested inside another , with a sibling containing a function that is invoked when the text is changed.

    Please let me know if you need more.


    May 26, 2016 at 4:44 am #1918

    Emailed twx directly since it cannot be posted to forum

    May 26, 2016 at 6:54 am #1919

    The attached illustrates a solution to this issue.  The result shows the alert that was issued when I tabbed off the Text field.

    Sabina Rosa Olga Luzzatti
    May 22, 2018 at 12:23 pm #5162

    Could I please have the same twx ?

    Thank you

    Sabina Luzzatti

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

You must be logged in to reply to this topic.

Start typing and press Enter to search