Hi Kalpa,

User pref are used to allow the user to set the his preference to the
gadget once its loaded. I am not clear why do you set the preference via
the code. Usual behavior we use is as follows.

*In you gadget.xml file *

<UserPref name="dataSource"
              display_name="Data Source"
              default_value="../../portal/apis/flot-data-files/dataFile4.jag">
</UserPref>

*And you accessed the user set value as follows in your gadget processing js*

var pref = new gadgets.Prefs();
var url =  pref.getString("dataSource");

You can find more information regarding user prefs in this article [1]
<http://wso2.com/library/articles/2011/11/writing-google-gadgets-tutorial-part-03/#GoogleGadgets_p3c1>

[1]http://wso2.com/library/articles/2011/11/writing-google-gadgets-tutorial-part-03/#GoogleGadgets_p3c1

Thanks,
Tanya



On Wed, Jun 18, 2014 at 10:08 AM, Kalpa Welivitigoda <[email protected]>
wrote:

> Hi,
>
> How can I send user pref to a gadget with UESContainer? I tried the
> following but it doesn't work for me.
>
> UESContainer.renderGadget('gadget1', '
> https://localhost:9443/portal/gadgets/line-chart/line-chart.xml',
> '{"dataSource":"data.jag"}');
>
> --
> Best Regards,
>
> Kalpa Welivitigoda
> Software Engineer, WSO2 Inc. http://wso2.com
> Email: [email protected]
> Mobile: +94776509215
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Tanya Madurapperuma

Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94718184439
Blog : http://tanyamadurapperuma.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to