26
Views
4
Comments
Calling Handler of a Widget on creation
Question
Application Type
Mobile

I have a list (Aggregate) from which I want to display to the user the value of one of its columns. There might be duplicated values in that column. I want to display each value only once. Grouping that column on the Aggeregate won't work for me as I need other columns as well. So my idea was to sort the list according to that value, and in each itteration of the list, to store on a local variable the last value. Before creating a widget to the current value, I check if the new value (list.current.entity.value) is different than the previous one stored on the local variable. If it does, I skip to the next ittereation without creating a new widget. I used a Card widget with an Expression widget within it to display the value and the Expression's OnChange event to call a local function that updates the local variable. Unfortunatelly it doesn't work. It seems that the handler isn't called. Attached is a screenshot (ignore the first condition at the Expression Editor). Any idea? 


Screenshot.png
2024-11-25 22-05-29
Sergio Aznar Guallar

Hi Yaron,

Another option to achieve this is using web blocks, first use a list widget with your aggregate as the list, inside the list item place a new web block that will have an input parameter whi will be the current record of the list, and then inside the block, use that input in a new aggregate to show all of their columns that you want.

hope it helps, let me know if it works


Kind regards,

Sergio

2024-12-10 04-40-04
Gitansh Anand

Hi @Yaron Ben, I would suggest you use SQL with the distinct keyword; read more about it here

2023-10-16 05-50-48
Shingo Lam

cannot use SQL. As mentioned above, "group by" is already used 

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