16
Views
4
Comments
Solved
DatePicker - on click to show relevant list with meetings for chosen date
Question

Hello,

I have a Screen with a Datepicker and I want the functionality to choose the date and depending on the date the relevant List with meetings will show up below. And then I can choose the meeting and view its participants on another Screen.

I tried to implement the logic, but had no success. I feel like I am confused at all. I did not find a similar post with solution earlier.


Sorry for any silly question (I am a Starter).

Could you please kindly help here to correct the logic?

OML is attached.


Thank you all in advance.

testdatepicker.oml

Rank: #222
Solution

Hi Mikhail,

Follow attached a new version of the .oml


What I did here is when you select your date in calendar the list is updated, and then you can select one meeting to go to it details screen:


The changes I made was mainly:

- Change your aggregate, removing the group by and applying a filter for the date:


-Change the DatePicker select event to just refresh your aggregate:


And also created a new screen to receive a meeting id and show it details, that can be accessed clicking in the list row:


And that's it!! Easy as doing a mobile app in OutSystems :P

Let me know if that helped,


Cheers and Regards,

RR :)

testdatepicker.oml

Rank: #222

Hi Mikhail,

If you want to start the page without any items, you can remove the first part of filter from aggregate.

If you look in the picture I previously sent, I put an observation in red.


"If no date selected bring all , otherwise just the meetings with selected data"


The first part of the filter

Date = NullDate() do it.

If you remove this part only the meetings of the selected date will return :)




This practice is commonly known as curt circuit in filters.

It first check if the variable used to filter is empty, and if yes it don't evaluate the next condition that would be Meeting.Date = Date, this way every item in the table evaluates true and are returned, because the variable is empty.


Practical example:

in filter:

Date = NullDate() or Meeting.Date = Date.


- Case, the Date var is Null, the condition will be:

True or Meeting.Date = Date

Since the first part is True, it will not evaluate the second one, because the first already passed the test.


- Case, the Date var is 12-30-2020, the condition will be:

False or Meeting.Date = 12-30-2020

In this case only the objects with date 12-30-2020 will be returned from DB.



Let me know if the explanation was not very clear, and I try to improve it.

It is a little hard to explain.

Cheers and Regards,

RR :)