2022.12.14 12:23 AM
what I plan to do :
to display a pop up, reminding users that end date is earlier than start date, when a wrong end date is chosen and refresh button is pressed.
what I doing is:
add an action for button "refresh", then assign a condition expression
$[endDate>startDate;alwaysTrue,alwaysFalse]
to a popup's view state:
isInvalidEndDate
however the pop up will show up no matter if condition expression is true or not.
inside pop up, the end date and start date is displayed,
So how to control a pop up visibility with other view states?
2022.12.16 05:32 AM
Thanks for sharing @findpippi
Welcome feedback from fellow contributors here.
2023.01.10 07:16 PM
Hi findpipi,
The approach I would take to resolve this would be to add a new viewstate called refresh in your button.
This viewstate would be set to 1b when selected.
You would then have a query mapper set up to take in your inputs of refresh, startDate and endDate.
Your query mapper would then run something like the following:
{[refresh;startDate;endDate]
$[refresh;
:$[endDate>startDate;
`refresh`popup!(0b;1b);
`refresh`popup!(0b;0b)
];
:()
]
}
This way, only when refresh is true, will the check be performed and once the check (regardless of whether endDate is greater than startDate is true and if so set popup to be true) is completed, refresh will be reset back to 0b so that the check will always occur once the user selects refresh.
Hope the above helps.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.