Mandatory range parameters : "To" style not updated after being filled manually
Description
Environment
Attachments
testing discovered
Activity
Carlos Ruiz February 17, 2021 at 5:16 PM
Hi , Hi
Testing this I found this comment I added some time ago. So, I got curious about the effect of this change.
Enabling the ValueChange on the To editor have the consequence that logic from other fields are triggered when changing this field (read-only, mandatory, display)
The other effect that can cause problems is how the context variable is filled:
before the patch DateInvoiced is filled with the From parameter
after the patch DateInvoiced is filled with the To parameter
This changes the behavior of context, which could lead to wrong logic applied
However having the To in context could be good, but I think it would be better if the context variable has a different name, so it can be used in logic from the other fields, for example DateInvoiced is still having the value of the From, and we create a new variable DateInvoiced_2 for the To value, like jasper and webservices name it.
This can allow the To fields to be used in the logic of the other fields too.
Also, if we do this change, I think we need to drop the comment on line 534, and instead add these lines below:
A collateral related thing I noticed is this:
assigned DisplayLogic to DateInvoiced parameter = @IsSOTrx@=Y
then the To parameter is not painted red with or without the patch
About the other patch from (red label when To empty) - it looks good.
Regards,
Carlos Ruiz

Anozi Mada February 17, 2021 at 8:10 AM
Room for improvement: Add mandatory style on label when Parameter To is still blank.
But I’m not sure the code is good enough so I’ll just attach the patch for that here.

Anozi Mada February 17, 2021 at 7:58 AM
Pull request:
Hi,
Log in System and open process/report window on "Daily Invoice_RV_C_Invoice_Day"
Set "DateInvoiced" parameter (range) as mandatory
Login in GardenWorld and launch the report
DateInvoiced "From" and "To" have red borders
Fill both fields
"To" has still the red borders
nb: not reproducible if SavedParameters are used