Wizard Template - List view must not be empty before proceeding

0
Dear Mendix developers, I have the following situation: I created a form in a page where people can enter different types of data over several pages. In one of my pages, users can basically click a button and an additional popup opens, where they enter contact details. They can add as many contact details for that specific item as they want (basically a shopping cart logic – add as many as you want). To display these contact details I created a list view which shows them in the form. I have a proceed and a save button in that page.  I want to do a validation check before the user leaves that page, if the list view is empty or not. The user shouldn’t be able to leave without at least providing one set of contact details (multiple fields, otherwise I would have chose a string input with the standard validation). Is there a way to achieve this? I was thinking of calling a microflow on save (or proceed) that checks if the contact details are there, but my problem is, that I cannot limit this to only the current “project” (so the “item” I fill out the whole form for). Thank you in advance.
asked
1 answers
1

Hi Philipp,


From the scenario which I understood , 
 I am thinking you have a outer data view and have this button inside that data view when button is triggered you are opening a page with a associated entity which can be filled .

I will suggest when you click on the proceed button you can try to do a retrieve by association (this will include In-memory new objects contacts) from the Project entity to the contact details entity if user has created some data this will not be empty and you can proceed or show a information or error pop as per your requirement.

I am not sure if there can be already some contact details associated which are not shown for that project in this page in such case you can try to use function IsNew() which can let you know if a object is newly created object or a database object .

answered