Hello,In the below picture I write a jquery code and value assigned to output parameter and set this value to message. Here 1st time I get the value but after that I didn't get any value. I don't know what happen with this.JQuery Code:
$('.handle1').change(function(e){ $parameters.GetValue = ""; var Slideval = ""; Slideval = e.value; $parameters.GetValue = Slideval; alert($parameters.GetValue); $resolve();});
In alert I get the value every time but I message I didn't get any response. Please help me out from this.
It is for mobile app.
Hi Suhas,
I think I know what's going on, but since I'm not a JavaScript wizard, I'm not 100% sure.
What I think happens:
I'm not sure how to do what you want, you might want to check the documentation for the widget.
I assume this code lives in a Screen Action? When is this Screen Action called? Did you debug your code?
Hello Kilian,On parameter Changed action I set this code. I get alert every time when parameters changed but in messaging I didn't get changed value.
Suhas,
Are you sure you are assigning javascript block's output to your message?
Hello Suraj,$('.handle1').change(function(e){ $parameters.GetValue = ""; var Slideval = ""; Slideval = e.value; $parameters.GetValue = Slideval; alert($parameters.GetValue); $resolve();});$parameters.GetValue this is output parameter.
Some observations about the JavaScript:
1) If you can avoid it, don't use JQuery in mobile. It's pretty bloated and may/will affect performance.
2) Why do you first set $parameters.GetValue to "", then always to another value? The former seems superfluous.
3) Same for Slideval, why not directly assign it to e.value? Or better yet, why not assign e.value directly to $parameters.GetValue?
4) What's the $resolve for?
That said, can you share an eSpace that shows what you're doing, as I'm not sure I understand how you've set up things.
Hello Kilian,I already Slideval = e.value but it not working so I made a changes.This is asynchronous that why I use $resolve.See the attachment.
Thanks Kilian for your valuable time.
I used input box and set the e.value to that input box using jquery. now it's working fine.
Great to hear you got it working. Happy coding!