getGadgetData() webmashup api method always returns undefined
Hi ,
I'm using below piece of code for reading data from my mashup gadget and show it on HTML , but it always returns undefined .
<div id="wrapperDiv"> <input type="button" value="Set class on Gadget A and load Gadget B " onclick="setonGadgetA()"/> <label>MemberID is set to: </label> <input type="text" value="" id="valueFromGadget" name="valueFromGadget"/><br><br>
<script src ='http://localhost:8080/prweb?pyActivity=pzIncludeMashupScripts'></script> <script> function setonGadgetA(){ var valueFromPegaGadget= pega.web.api.doAction("PegaGadgetNew", "getGadgetData", "primarypage.pxCreateOpName",{"callback":function(response){}}); document.getElementById("valueFromGadget").value = valueFromPegaGadget; } </script>
ValueFromGadget is always set to "undefined" . Has anyone faced similar issue ?
thanks,
Rima
***Edited by Moderator Marije to change Type from Discussion to Question***