cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: Integer Validation

Former Member
0 Kudos

Hi All,

I am using a integer for an input field as assigned defualt value as 1, but if user changes it to any char eg:a, this is resulting in a error message

"Value a contains non-numeric characters "

which is given by Webdyn pro, and blocking the remaining functionality untill the value is changed to integer value.

Please suggest me how can i overcome this

Thanks

-


Nagaraju

Accepted Solutions (1)

Accepted Solutions (1)

siddharth_jain
Active Contributor
0 Kudos

Hi,

go to action tab of view,

right click on the action associated with the button and edit

check without validation check box.

deploy the new archive and see if it works.

Answers (2)

Answers (2)

siddharth_jain
Active Contributor
0 Kudos

Hi,

if input field does not require any input from user apart from the default one then first you can set the enable property of input field to false.

and Webdynpro framework validation applies when your action event handler is created with Without validation option unchecked.

try checking this option of event handler.

Siddharth

Former Member
0 Kudos

Hi Siddharth,

I want user to enter values, but expected is only integer. But if user enters a char Eg:a Webdynpro validation is taking place, which i want to skip..

Thanks

-


Nagaraju

former_member192434
Active Contributor
0 Kudos

Hi

Create a context attribute and set the data type as integer

and put the validation logic on onEnter action

Thanks

Anup

Former Member
0 Kudos

Hi,

I have done the same, problem now is if user enter a char value Eg:a, validation is done from webdynpro and showing error as i mentioned, which i dont require.

Thanks

-


Nagaraju

former_member192434
Active Contributor
0 Kudos

Hi

take the help of this sample cod, once you achived this functionalty then set a boolean type flag as true, and use this flag for rest of the procdure.

i mean once this flag is true then put a condition to skip the rest of the process.

DecimalFormat pattern = new DecimalFormat( "#,##0;(#,##0)" );

String numberString = "(1,234)";

Number n = null;

try

{

n = pattern.parse( numberString );

}

catch ( ParseException e )

{

//( "oops:" + numberString );

// n = new Integer( 0 );

for more details

check this link

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/837d9290-0201-0010-1381-e633fe17...

Thanks