In code i only receive: taskList = “MyFirstModule.Task” So how to properly pass entity list, and access it in java script? "> In code i only receive: taskList = “MyFirstModule.Task” So how to properly pass entity list, and access it in java script? "> In code i only receive: taskList = “MyFirstModule.Task” So how to properly pass entity list, and access it in java script? ">
How to pass and access entity data to Cutom Widget - Mendix Forum

How to pass and access entity data to Cutom Widget

0

I need to implement custom widget to work with entity list.

I need to put widget in listView with entity Task, and pass this Task entity to custom widget.

But, when i try to do it like this: 

<property key="taskList" type="entity" isPath="optional" pathType="reference">

In code i only receive:

taskList = “MyFirstModule.Task”

So how to properly pass entity list, and access it in java script? 

asked
1 answers
0

In my opinion the easiest way to send complicated data to a widget is by using JSON. You can use an export json mapping to map your task list to a json string and then send this string to your custom widget. Then in javascript you can easily convert string to json using

var taskList = JSON.parse(json_string);

Hope this helps,

Andrej

answered