TemplateGrid Datasource executes twice

0
I'm new to Mendix, so I'm hoping this is a simple mistake on my part. I have a page with a DataView. The Datasource type for the DataView is "Context". Within this DataView I have a Tab Container. One of the Tabs of the Tab Container has a Template Grid. The Datasource for the Template Grid is a microflow. Using the "Edit" button for a Template Grid item opens an "Edit" page for the selected item. (So far so good, everything works as expected up to this point.) On the Edit page, I have an Action Button with OnClick set to "close page". Hitting this button results in the Datasource for the Template Grid being called twice. One of the calls has the DataView's Context object set and One of the calls has a Null value for the Context object. The order of calls appears to be random; but the microflow is consistently executed twice. This behavior leads to the Template Grid showing incorrect result whenever the DataView's Context object has a value of Null. Reviewing forum questions, I came across a similar issue posted 3 years ago without a posted answer. (So I'm hoping to have more luck with this post.)
asked
3 answers
1

If it is an action buttun did you try to set disable during action to yes? Because to me it looks like sometimes double clicks are registred. By setting it to yes an user can only click once on the button.

Regards,

Ronald

answered
1

For anyone else experiencing this issue, Mendix has confirmed that it is a bug and they are currently working on the issue.

For those that haven't yet encountered this problem, it will occur when you have 2 or more TemplateGrids on different tabs of a Tab Container. (In my scenario, I have a Tab Container with 3 tabs and each tab has 1 templategrid.)

My testing suggests that 3 calls occur when closing a page that attempts to return to Tab 2 or 3:

  1. Datasource microflow for the TemplateGrid on the "return tab" is called
  2. Datasource microflow for the TemplateGrid on the first tab is called
  3. Datasource microflow for the TemplateGrid on the "return tab" is called

 

Call #1 or #3 will contain a Null value for the Context variable. If call #3, contains the Null, then an error will occur within your app.

 

Hope this helps someone out there.

answered
0

Form your description this looks like it is simply a Mendix bug. If you feel like it you could submit a ticket for it in the support portal.

answered