How to use the Date Picker widget to update an existing aggregate within a screen
Application Type
Mobile
Service Studio Version
11.10.18 (Build 40944)

Hi everyone! I'm trying to use a date picker widget to manipulate which records show up in a table on my screen. I've gotten the widget to appear on screen when clicking a calendar icon and am able to filter the records of the based on the initialized local variables I'm using to filter on, however when I update the dates in the calendar the table doesn't refresh despite the client action I've configured to do just that.

Here are the properties I've configured for the calendar so far:


Here is the aggregate with the filter I am using to filter dates based on the local variables:

Here is the configuration of my assign statement to change the local variables based on dates selected in the calendar and the refresh tool for refreshing the aggregate and its filter in my client action for "OnSelect":


I initialize my local variables with the current day's data and from there allow users to find the data they need using the calendar, however as on now the table does not update.


Thanks in advance for your help!


Mike

Solution

Hello @Michael Saia,

João Marques is right. but overall there are 2 issues so I want to elaborate to make sure we get this right: 

1. In your dateselector - dateselectorOnSelect handler, you must assign the 'StartDate' and 'EndDate' so that the dates selected by user in the Date Picker are assigned to the widget correctly.

2. Then in the dateselectorOnSelect logic's assignment, the assignment should be the other way around, as shown below, so that the selected dates from the datepicker are now assigned to the local variables used by the aggregate:

This should do it,

Regards,

AJ

@=AJ=  This did it, thanks for your help! The explanation helps me explain why this wasn't working as well. Really appreciate it.

mvp_badge
MVP

Hi Mike,


On your action dateselectorOnSelect you are assigning StartDate to DateStart while you want the other way around :)

The same thing is also valid of course for the EndDate and DateEnd.


Kind Regards,
João

Thanks Joao! Silly mistake on my end, thanks a bunch!

Joao, so I implemented your answer (which was needed I agree) however edits to the calendar still do not affect the data in the table. Do I need to trigger a new event to communicate with the table that the aggregate has changed? Just spitballing here.

mvp_badge
MVP

Having seen your message just now, I gladly see that AJ has already completed the answer with what was missing.

In that case, please mark his answer as a solution so other people with the same problem can find the solution for the issue.


Kind Regards,
João

Solution

Hello @Michael Saia,

João Marques is right. but overall there are 2 issues so I want to elaborate to make sure we get this right: 

1. In your dateselector - dateselectorOnSelect handler, you must assign the 'StartDate' and 'EndDate' so that the dates selected by user in the Date Picker are assigned to the widget correctly.

2. Then in the dateselectorOnSelect logic's assignment, the assignment should be the other way around, as shown below, so that the selected dates from the datepicker are now assigned to the local variables used by the aggregate:

This should do it,

Regards,

AJ

@=AJ=  This did it, thanks for your help! The explanation helps me explain why this wasn't working as well. Really appreciate it.

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