CalendarEvent caption as HTML


is there a way to enable HTML for the caption of calendar events?

I’m using io.jmix.ui.component.Calendar and io.jmix.ui.component.calendar.SimpleCalendarEvent in my code.

I found this solution, unfortunately that doesn’t work with the JMIX calendar component anymore.

Thanks in advance!


Could you clarify version of Jmix do you use? I’ve tried the solution for event captions in 1.1.2 version and it still works:

private Calendar calendar;

public void onInit(InitEvent event) {
    calendar.withUnwrapped(JmixCalendar.class, vCalendar -> vCalendar.setEventCaptionAsHtml(true));

To enable HTML description in Calendar you need to add compileWidget gradle task and widget configuration in the build.gradle:

dependencies {
   // implementation 'io.jmix.ui:jmix-ui-widgets-compiled' // comment or remove

   implementation 'io.jmix.ui:jmix-ui-widgets'
   widgets 'io.jmix.ui:jmix-ui-widgets'

compileWidgets {
    generate ""
    includePaths('**/io/jmix/**/widget/**', '**/com/company/myapp/widgets/**')

And add app property for widget set:

Then create the same connector class like in CUBA but with Jmix naming and place it under the package:

@Connect(value = JmixCalendar.class, loadStyle = Connect.LoadStyle.LAZY)
public class MyAppCalendarConnector extends JmixCalendarConnector {

    public TooltipInfo getTooltipInfo(Element element) {
        TooltipInfo tooltipInfo = super.getTooltipInfo(element);
        return tooltipInfo;

The result:

The demo project: (83.3 KB)


Thanks for your reply!

I currently use Jmix version 1.0.3, but your solution worked perfectly in my project, thank you very much!