446
Views
7
Comments
Solved
I wanted to know how to bind 0 (zero) .
Question
Application Type
Reactive

Hi everyone 
I wanted to know how to bind the integer 0(zero) in the textbox.
While entering the form 0(zero) is getting accepted and when I edit the form the integer 0(zero) is not binding.
However except 0(zero) all other integers are getting binded when I edit.


Can anyone help me with this.

Thank You & Regards
Bharath

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello Bharath.

In fact, you can change the variable to text and validate inside if it is a valid number before saving to database. But that is too much work.


Why it happens:

0 is the NULL value of integers.
So when the variable has value 0, it is assumed as empty.

How to fix:

On the input add a property:

This will show the 0 and don't have to change anything else.

2022-09-04 15-01-10
JayPea

@Nuno Reis 

Helpful thanks.

2022-09-04 15-01-10
JayPea

Hi @Nuno Reis 

I'm trying to apply this as a FALSE to an input field but it's behaving strangely.

In the previewer I'm getting "Error in widget container" and also the value is still displaying in the browser.

Am I correct in thinking I apply this to the input widget attribute?

show-default-value = False

2018-08-27 08-29-35
Fábio Vaz

Hi,

Try change the input type to text

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello Bharath.

In fact, you can change the variable to text and validate inside if it is a valid number before saving to database. But that is too much work.


Why it happens:

0 is the NULL value of integers.
So when the variable has value 0, it is assumed as empty.

How to fix:

On the input add a property:

This will show the 0 and don't have to change anything else.

2022-09-04 15-01-10
JayPea

@Nuno Reis 

Helpful thanks.

2022-09-04 15-01-10
JayPea

Hi @Nuno Reis 

I'm trying to apply this as a FALSE to an input field but it's behaving strangely.

In the previewer I'm getting "Error in widget container" and also the value is still displaying in the browser.

Am I correct in thinking I apply this to the input widget attribute?

show-default-value = False

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello @JayPea .

It is just like the print I shared. I did it to answer the question so it was working days ago.

2022-09-04 15-01-10
JayPea

Ok thanks, not sure what's happening but will continue investigating. 

2022-09-04 15-01-10
JayPea

Hi @Nuno Reis 

I figured out it only works on system defaults. As I had given my structure my own default it didn't work. I guess it's not technically a "default" in that instance.

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