Calendar widget : new event reference causes error

Hi, I started a new application and would like to use the Calendar widget. The application has a simple model  The calendar widget is placed inside a data view with type Employee, which is selected from a list. This is how the calendar widget is configured :     As soon as the "new event reference" is set the calendar generates errors (in chrome): 1. when the calendar is clicked to add a new event a popup with a general error appears (but no message in the console log) 2. the on click event to edit an existing event doesn't work anymore and a log message in the console appears : Caused by: java.lang.IllegalArgumentException: requirement failed: Reference 'Employee.Event_Employee' only accepts ids of type 'Employee.Employee' (Id '[MendixIdentifier:: id=14355223812243459 objectType=Employee.Event entityID=51]' is not allowed).   What is wrong with this configuration? Any help is welcome. Olivier  
2 answers


A couple of questions:

  • When you get the new event error, have you looked in the Chrome developer console to see if there are any errors  there?
  • This seems like a very straightforward configuration, is there any reason you are not using XPath constraint for your data source?  I am not sure if this will resolve your errors, but it may have some impact.


*** Edit ***

There are bugs in the most recent release of the Calendar widget.  I identified bugs in the javascript that creates a new event (local variable names don't match) and in the click event, the widget tries to set the context reference value to the Event guid instead of the Employee guid (not sure if or why the widget needs to set the reference when an event is clicked).  In any case, if you download version 5.2.2 of the widget (dated 10/6/2017) all of these things work as they should.  I have just created an Issue in Github referencing this thread.


It looks like you have the microflow with context object set as your datasource here.  It could be that your data source microflow (Employees.GetEntities) is not returning the correct events and/or employee.   I would recommend checking out that microflow to ensure you are returning an 'Employee' object.  It looks like there is an empty object based on the error message.