Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceTimelineView onSelect() "resource" Parameter seems to be missing infos #4

Open
r4inX opened this issue Jun 13, 2023 · 5 comments

Comments

@r4inX
Copy link

r4inX commented Jun 13, 2023

Hey Guys,

updated my servoy to 2023.06_RC1 and all compoments. The premium plugins work now, thanks.
Other issue i found:

When u use a ResourceTimelineView and select a daterange for the onSelect() method. The parameter "resource" (svy-fullcalendar2.ResourceObject) seems to be missing data.
It only shows {Title: xxx} but not for example the resource.id. So i cant get the selected resource on which i selected the date.

The method onDateClicked() works. The resource parameter got every data. But its only for a single click, not a selected date-range.


How to reconstruct the case:

  1. create a fullcalendar2 component in your form
  2. initialize the view as "resourceTimelineMonth"
  3. add 3 resources, for example 3 hotel-rooms
  4. use the "onSelect()" method and output the parameter "resource"

You will see it only gives back {title:1 – 30. Juni 2023} for example.
It should give back (onSelectDate() Method):
{eventBorderColor:null, eventTextColor:null, eventOverlap:null, eventBackgroundColor:null, id:2ba6c08b-c37e-4524-ab5d-7a4a02ddae9a, eventConstraint:null, title:}

Greetings
-r4in

@r4inX
Copy link
Author

r4inX commented Jun 13, 2023

Found a workaround.
If you application.output(arguments[7].id) in the onSelect() function, you can get the resource.id.

So i guess the positioning of the arguments is just shifted.

@costescuandrei
Copy link
Contributor

costescuandrei commented Jun 20, 2023

Yes, I see that for some reason, client side code calls it like this:
this.onSelectMethodID(selectionInfo.start, selectionInfo.end, selectionInfo.startStr, selectionInfo.endStr, selectionInfo.allDay, selectionInfo.jsEvent, this.stringifyView(selectionInfo.view), selectionInfo.resource);

So with 7 arguments... while the spec file only defines 6 arguments.
So the "allDay" param seems to be missing from the .spec file. I will add it; after that, the generated handler should have the correct args and client should send things correctly to server.

@costescuandrei
Copy link
Contributor

@costescuandrei
Copy link
Contributor

Pushed.

@r4inX
Copy link
Author

r4inX commented Jun 20, 2023

Thanks @costescuandrei ! for now i have a working workaround. but its still nice that you fix this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants