Entitycalendarevent

I am trying to run the session planner example but get an error in SessionBrowse.java. At the line where i assign the change in the session I am being prompted that EntityCalendarEvent requires 2 arguments.

Session session = ((EntityCalendarEvent) event.getCalendarEvent()).getEntity();

image

What should I do to correct this?

@wedderm,

Sorry, you image is so small, so there is no chance to see what is written. Could you please attach better image, and even better - your project zipped.

Regards,
Aleksey

Thanks for your speedy reply. Please see attached. i hope its clearer. I tried to send the zipped project but was told its too large.Cuba error.docx (558.3 KB)

modules.zip (285.4 KB)

Please see attached for a portion of the project.

This will solve your problem:
image

You use version 7.2, where API has slightly changed comparing to 7.1, which is used for the sample.

Regards,
Aleksey

1 Like

Thanks for your speedy response. Problem solved.

1 Like

I have one more problem. Please see attached.Cuba Error 2.docx (747.7 KB)

Please, try to google this problem. This one with unfetched attribute was explained a lot of times. Like here IllegalStateException: Cannot get unfetched attribute from detached object - CUBA.Platform.

1 Like

I’d recommend to read Mario David’s article to get better understanding of views concept and solving unfetched attribute errors:

Hi,

It happened because the editor’s view does not contain all attributes of the browser’s view. You can fix this by defining editor’s view as an extension of the browser in views.xml, like this:

<view entity="sessionplanner_Session" name="session-edit-view" extends="session-browse-view">
</view>

We have also created a ticket to prevent this in future releases: Unfetched attribute error if editor view is narrower than browser view · Issue #2797 · cuba-platform/cuba · GitHub