[FullCalendar Reactive] Fetch the events of the calendar inside a block on the first loading of the screen
Forge component by André Cabral
Application Type
Reactive

Hello,

I am trying to fetch all the events of a calendar inside a block so when we open the browser the first time all the events appear.

For now, the events are created but they appear on the calendar only when we refresh the page.

I have tried to refresh the page in the OnReady of the block, to see if the calendar would refresh too, but I noticed that all the page refreshes before the calendar appears.

I do not know if there is a way to make the calendar appear with all the events already exisiting in the database following a different approach, I have tried many things for now and none worked.

If there is not enough information on the post, please let me now so I can try to explain better the problem, it's the first time that I am sharing a problem of this kind and I do not know if it is well explained.


Thank you in advance.

Best regards

Calendar.zip

Hi Ismael,

Try the following and check if it helps -

1. Enclose the calendar widget within an If statement with the condition [youreventdatasource].IsDataFetched.

2. To the EventSources input of the FullCalendarReactive block, pass in NewEventSourceData([youreventdatasource].List). The output of [youreventdatasource] should be of the 'Event' structure type from 'FullCalendarReactive' block


Hi Pavithra,

thank you for answering, it has been very helpful!

Thanks to your answer now the block refreshes, but another problem has appeared.

The problem now is that all the data does not appear on the calendar. It is due to the if, if I take the if off all the data shows again on the first page refreshment.

I will attach to this post the actual version of the Calendar in case it helps (It is way different of the first one due to all the different attempts to solve the problem)


Thank you in advance.

Best regards

Calendar.zip

Hi Ismael, 

I looked at your solution and I see that the input to EventSources is not passed correctly. 

I have attached a simple solution for you. I have a simple screen with the data source similar to what you have in your solution

In the OnAfterFetch of GetEventDbs, I have the following conversion. FullCalendarReactive  expects EventSource List and not the Events List



This is what I have in the UI. We can also skip the If mentioned in my earlier thread.

You don't need any of the extra refreshes that you have in OnReady and other events.

I see the following output and it works well-


Let me know if it helps

Calendar.oml

Hi Pavithra,


After trying to implement your solution to the calendar I decided to start it from scratch and after a couple of attempts I could get the same solution that you reached.

Thank you so much, it is working for now!


Best regards, 

Ismael

Hi Pavithra,

I got the same problem, but i can't download attached files.

Could you please help me to solve my problem

CalendarMain.oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.