Sitecore things

Sitecore best practices, architectures, EXM, SPEAK...

Sitecore SPEAK - Could not select row in ListControl

I use ListControl from SPEAK a lot and most of the time I use self-defined datasource components for ListControl's items.

This week, I bind a ListControl to a new data source as usual. Just an example, the data source is a JSON object array.

enter image description here

I bind a ListControl to this datasource.

enter image description here

The control displays the items as expected, so far so good.

enter image description here

However, I could not select any row in this list.

The reason is that the "selectedItem" or "selectedItemId" attribute of a ListControl requires an default "itemId" property from the datasource and the items in my JSON object array do not have "itemId" field. When I add the "itemId" into each object in my JSON object array, I can select the row again.

enter image description here

In sum, when we define a datasource component for ListControl, we need to make sure that we include the "itemId" for each item in the datasource.