cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict user input to numbers

Former Member
0 Kudos

Hello All,

Is there a native functionality to restrict the user input only to numbers in say inputfield UI elem? other than writing code to check what has been entered

Cheers

Senon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Play around with creating Simple Types and the external and internal representations. There should be some way of creating a Simple Type that meets your needs.

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear Senon,

To provide the functionality desired by you, you can create a simple type of type integer and bind it to the input field type. If you are fetching data from an RFC, then the type of the input field can be the type of your Model Node attribute. You just need to bind the type to the attribute.

I hope it helps, if oyu are looking for something more, please revert.

Cheers!!!

Umang

Former Member
0 Kudos

Hello All,

Thank you for the answers, but not exactly what I wass looking for,

My question is, is there a way to restrict the user from not typing any charectors and only allowing numbers in the input, while typing? not on lost focus action?

Many thanks.

Regards

Senon

former_member214651
Active Contributor
0 Kudos

Hi Senon,

U need scripting to achieve such features which is not supported in WDJ. U have to check on enter or any action button

Regards,

Poojith MV

Former Member
0 Kudos

Hello

Thanks a lot, though it does not solve my problem, I get the clear info that its not possible. I have to bring the expectation down and do it on an action

Cheers

Senon

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

check the Format inputfield when using simpletypes. More details here:

http://help.sap.com/saphelp_nwce72/helpdata/en/48/57551fc01071b9e10000000a421937/frameset.htm

Still what you'd like to achieve is not possible I guess, because a validation must take place in order to decide what you have entered in your browser on client side. A round trip is necessary to have the validation as per the WD Phase Model (http://help.sap.com/saphelp_nw70/helpdata/en/13/aeeb41eda96624e10000000a1550b0/frameset.htm).

Perhaps using some kind of scripting this is possible, but I am not sure we provide support for it in case any question raises.

Cheers,

Ervin

gill367
Active Contributor
0 Kudos

Hello Senom,

Simply bind the input field to the attribute of decimal type and it will provide you the inbuilt validation of WD framework

Thanks

Sarbjeet singh

Former Member
0 Kudos

HI,

1. Create a simple type of type decimal / integer whatever suits your needs.

2. Create a value attribute and declare it to be of type mentioned in 1.

3. Bind the value property of the Input field to value attribute declared in 2

Regards,

Himanshu