Saroj PandaFebruary 24, 2017 at 7:53 am #3832
We have the requirement to do the validation calculation on the Blur events of the controls and realized that the Integer and Decimal controls are resetting the validation set by the inline script.
For quick testing I took Text, Integer and Decimal controls in one coach and added me.setValid(false, “On blur validation test”); script on Blur event of these 3 controls. When I run the coach and did focus out from controls only Text control added the validation error* while integer and Decimal controls were looking normal.
Then to test whether the event is being executed of not I added console.log(“<Control> on change”); and did the testing. I was able to see the console logs from all 3 controls.
To take it further I added the validation and console.log script to Change event with appropriate changes to track each texts. I got interesting result. The Integer and Decimal controls are executing Blur event first (do some reset) then handle Change event, while Text control executes Change event and then Blur event. (All the screenshots are attached).
So I’m wondering what is the best way to use the Blur event of the Integer and Decimal controls to do the validation. I tried using the change event, but it is not of great use.
I have submitted a new request against this problem.
*Validation error text shown below control is done using custom control and has no impact on this problem behavior.SPARK SupportFebruary 24, 2017 at 3:04 pm #3840
I did respond to your Ticket earlier today. The order of operations for all controls should be On Change first, then On Blur. This is why the setValid() doesn’t appear to be working.
You can use a temporary work around of putting the setValid() in the On Change event. However, I have opened a bug to have the order of operations corrected in an upcoming release.
I will update your ticket with any new status information.
Stephen P.Saroj PandaFebruary 27, 2017 at 1:26 am #3855
Thanks Stephen for the update. Yes I saw your response on the ticket. I have updated the ticket with few more findings in Integer and text component which might be helpful along with this issue.
We hope we have this resolved in next release 🙂
SarojSPARK SupportFebruary 27, 2017 at 3:02 pm #3871
Yes. I will update the ticket with release status when available.
Stephen P.Phil NasMay 9, 2019 at 6:06 am #5484
I have similar problem ,
<div class=”zd-comment” dir=”auto”>
I Format the decimal field to have 2 decimal places. but every time i put 3 decimal places , automatically round the field.</p>
3.456 -> 3.46</p>
<p dir=”auto”>Question ?
How i remove the round ?</p>
</div>SPARK SupportJuly 23, 2019 at 9:22 am #5506
The Decimal control is based on the Dojo Number type. While the Decimal control provides options to set the number of decimal places, this does not change the way Dojo Number handles rounding. You would need to submit a Request for Enhancement to IBM asking for a new feature allowing trim instead of rounding: https://www.ibm.com/developerworks/rfe/
You must be logged in to reply to this topic.