Wijmo input number default value

Posted by: muhammad-hassan on 14 September 2017, 11:49 am EST

    • Post Options:
    • Link

    Posted 14 September 2017, 11:49 am EST

    Hi,

    By using Wijmo input number, default value 0 is always shown, how we can hide it and show empty value in input number field and only show value once

    there is any value.

    we are using wijmo with angular 2 in a webpack bundle.

    Regards,

    M. Hassan

  • Posted 14 September 2017, 11:49 am EST

    Hello,

    You can hide default value 0 and show empty value in InputNumber field. You need to set ‘isRequired’ property false and ‘value’ property null.

    For reference, please see the sample that implements the same.

    Thanks,

    Manish Kumar Gupta

  • Posted 14 September 2017, 11:49 am EST

    Hi Manish,

    thanks for your feedback. we need to put empty value for a field with ‘isRequired’ true, to apply validations .

    Pls. suggest some thing with [isRequired]=‘true’ and input number with empty value.

    Regards,

    M. Hasan

  • Posted 14 September 2017, 11:49 am EST

    Hello Hassan,

    ‘isRequired’ property itself explains that after setting it to true, we cannot set value of control to null. Hence is a correct behaviour. You can also refer to documentation for this property description.

    Could you please explain us about your requirement in detail where you need such implementation so that we can help you.

    Thanks,

    Manish Kumar Gupta

  • Posted 9 March 2021, 12:37 pm EST

    Hello,

    I also have a requirement where I have a required field, but our UX designer doesn’t want it to automatically be set to 0, he wants it left blank and decorated as invalid. The rationale is that 0 is a valid value, and if set automatically the user might not realize they have not entered their own value.

    Thanks

    Dimitar

  • Posted 10 March 2021, 1:48 am EST

    Hi Dimitar,

    In this case, you may simply set the isRequired property to false and implement the validation as would with any other control. Setting the isRequired property for wijmo input controls guarantees that a value is present at all times.

    Another option that you could try is initially set the isRequired to false and handle the gotFocus event, inside the handler set the isRequired to true. This will ensure that if the value is present then the user has focused the control at least once.

    Regards

    Sharad

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels