How to Listen-to-datagrid with Datagrid2?

3
One of the downsides of Datagrid2-widgets is that they do not show up in the list of available listen-to-widgets for a dataview: Is there a way to get a dataview to change upon clicking/selecting one object in a DataGrid2-widget? I tried with creating and associating an object to Session, but did not get the dataview to refresh. Does anyone have a workaround for this?
asked
2 answers
0

Wrap it in a Dataview of an associated non-persistent entity, like you said.

answered
3

A solution is:

  • Create a non-persistable entityNonP and associate it to your Entity *-1
  • Wrap a entityNonP-Dataview around your entity’s datagrid2 and dataview
  • Give the entityNonP-Dataview as Datasource a nanoflow which creates a entityNonP
  • Give your entity’s datagrid2 a onclick nanoflow that sets the association entityNonP-entity to the clicked entity
  • Give your entity’s dataview as datasource the associated entity

_______________________________________________________________________________________________________________________

_______________________________________________________________________________________________________________________

_______________________________________________________________________________________________________________________

_______________________________________________________________________________________________________________________

 

_______________________________________________________________________________________________________________________

Of course a downside is that the domain model gets an extra entity that we don’t really want.

Alternatively, you can use Session to associate with, but that requires admin-rights to module System.

answered