JavaScript Snippet widget wont parse my attribute value anymore

0
Hi community, We make use of the widget JavaScript Snippet (https://appstore.home.mendix.com/link/app/43096/) in Mendix 6. After the migration to Mx7 the widget stopped working, but only the context part of the widget. So, the attribute value was not parsed and therefore our javascript didn't work. I raised an issue on github for the widget, but maybe some of you have already solved the issue? Javascript code: var xhr = new XMLHttpRequest(); var url = mx.appUrl + "autologin/"; var params = "loginToken=${loginToken}"; xhr.open("POST",url,true); xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); xhr.send(params);
asked
3 answers
1

Hi Dave,

I created a test project in 7.19 and was able to get the widget to work with parameters. I would download the latest version from the app store to see if that fixes your issue.

answered
1

Thank you all for helping me with this problem. 

The answer was soooo obvious. The entity I used and the role I used it with did not have the access rules to read the attribute. Changed the access rules and voila, the widget works like a charm!

So, no issue with the widget and thanks again all!

answered
0

Hello Dave,

Wild thought, but maybe due to your quote marks the widget fails to replace ${loginToken} with your attribute? 

Could you try to see if using var params = "loginToken="+${loginToken}; works?

Hope this helps

answered