Search Support
-
Dave WakemanMay 25, 2016 at 2:54 pm #1913
<div>
Hello,
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.
</div>
<div>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.
</div>
<div>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.
</div>
<div>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.
Thanks!
</div>
SPARK SupportMay 25, 2016 at 3:12 pm #1915Hey 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 WakemanMay 25, 2016 at 5:17 pm #1916Well, 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?
jmacMay 26, 2016 at 4:16 am #1917Dave:
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.
jmacMay 26, 2016 at 6:54 am #1919The 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 LuzzattiMay 22, 2018 at 12:23 pm #5162Could I please have the same twx ?
Thank you
Sabina Luzzatti
-
|
You must be logged in to reply to this topic.