cancel
Showing results for 
Search instead for 
Did you mean: 

Integer default value

Former Member
0 Kudos

Hello,

I have an input field, where I should allow only integers 0...9. For this I am using integer simple type, but how can I set its default value to blank, not zero.

Searched in forums, no use.

Thanks,

Raj.

Accepted Solutions (1)

Accepted Solutions (1)

roberto_tagliento
Active Contributor
0 Kudos

into wdDoModifyView method of your view

IWDInputField InpEl = (IWDInputField) view.getElement("InputField_ID");

InpEl.setValue("");

Answers (1)

Answers (1)

Former Member
0 Kudos

Raj,

Try to use "objectTypes.integer" instead of integer. Click on elipse buttons when staying in attribute properties / type and select object type. This will create attribute of java.lang.Integer type (rather then int), and by default value of attribute is null (empty) rather then zero.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Valery,

Its working fine, but how can I limit the no of integers to enter like in simple types?. In my case, I shouldnt allow them to enter more than certain no of integers.

Thanks,

Raj.

Former Member
0 Kudos

Raj,

Create your own custom type in "Local Dictionary" of WD project. Select objectTypes.integer as base type and define inclusive min/max values (0 and 9 correspondingly).

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi!

I'm experiencing the same problem as described above, but I can't select "objectTypes.integer" as base type. This selection is not available. Do I miss something?

Thanks in advance

Fabian