dataview datagrid validation

1
I have data-view of Object (A) which has a relation with Data-grid of object (B) ,if I want to make sure that the user cant add object (A) without adding at least one object of (B) in the data-grid ,but the object (b) should not be saved until Object (A) is saved/committed . - how can i do that?
asked
3 answers
2

Object A only stays empty when you open a dataview and do not close it properly. This is not a bug, but required to make it possible for mendix to run on multiple servers. I cannot tell you the exact reasoning behind it, but i think it has something to do with the fact that if you have multiple servers running the same mendix app, atleast one server will need to know at which time something was created. Thus, objects are commited as soon as they are created. If you close your datagrids properly they will be rolled back just fine.

However, i know that customers tend to be thick headed in these things and so they do not cancel a dataview properly resulting in empty lines. What we usualy do is create xpaths on every grid that tends to display empty lines and remove the empty lines every week or so with a scheduelled event.

answered
1

This could only be done if you create the object with a microflow. But if you build a dataview of Object A and a datagrid of Object B over the relation from A to B than the modeller will automatically do a rollback when you cancel object A, you could also ensure this by setting your delete behaviour. Go to the domain model double click the relation and set the delete behaviour of the line to Always delete object B when object A is deleted.

answered
0

the problem that Object(A) is not deleted but it stays as an empty object even I did not commit it, and this is another bug

answered