Client or Runtime should be a data source option for data grids - Mendix Forum

Client or Runtime should be a data source option for data grids


Picture a simple data grid. My goal is to toggle a boolean value (on entity 'Vehicle'), shown in a column, when the user presses a button 'Toggle'.




'Toggle' is a simple microflow. It just has a change object activity that changes the boolean to not(ThatBoolean), Refresh in Client = Yes, Commit = No.


After the user presses 'Toggle' the only way to show this change immediately in the data grid is to:

  1. To create a helper entity, we'll call Helper
  2. Establish an association to Vehicle
  3. Put the Vehicle data grid in Helper's data view
  4. Set data source to Association
    1. Select path from Helper to Vehicle
  5. In the toggle microflow change activity Refresh in Client = Yes
    1. You don't have to refresh Helper - just the Vehicle
  6. And in the end you have a datagrid that updates when the user presses 'Toggle'


On top of those steps you have the otherwise-unnecessary maintenance and infrastructure:

  1. The new entity Helper
  2. The DV_Helper_CreateOrRetrieve microflow data source
  3. Associate Helper with every single Vehicle
    1. This might require a migration
    2. It will require updating the create and/or save microflows

But we should not have to bend-over-backwards this much to see client changes in a data grid. Both the client and runtime know what changes happened with the Toggle microflow. And I don't know enough to say which would be a better candidate. But it just seems to me I shouldn't have to fake an association to an object that I don't care about just to have a dynamic data grid. 


0 answers