cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting the decimal attributes

gill367
Active Contributor
0 Kudos

I have three input fields which are mapped to context attributes of type decimal.

now if you are trying to enter alphabetic characters and fire any event to navigae to other screen web dynpro automatically gives a message saying "Enter the value in -2317.45 format" and navigation is cancelled.

Now we can make the action non validating and to stop web dynpro from giving these error messages.

we need to reset the fields.so i am writing the code for same in the eventhandler just before firing the navigation plug of the action.But the problem is that it is not clearing the all the fields instead it is clearing the first field means it is resetting the first attributes leaving others as it is.

can anybody help?

Sarbjeet Singh

Edited by: sarbjeet singh on Apr 22, 2009 3:05 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member201361
Active Contributor
0 Kudos

HI,

But the problem is that it is not clearing the all the fields instead it is clearing the first field means it is resetting the first attributes leaving others as it is.

Are u sure that u are clearing all the attributes ?

if the Attributes belongs to a node, please make sure u are clearing the values for all the fields ?

i believe, u are getting the currrently selected element and clearing the values..that might be the reason.

gill367
Active Contributor
0 Kudos

Yah i am resetting all the attributes and the thing is for the first time only first attribute will be reset and if you are clicking the button to fire the event once again next attribute will be reset and next time third one will be reset.

former_member201361
Active Contributor
0 Kudos

HI,

can u post the code for clearing the data ?

Thanks and Regards

Former Member
0 Kudos

Hi Sarbjeet,

The problem you are facing is due to the fact that when you access the context the screen input is automatically traversed into the context and validated as otherwise there would be no current values in it. If during this traversal errors occur these errors will be shown because the values can't be moved into the context.

Maybe invalidating the node is an option for you.

wdContext.nodeTest().invalidate();

It won't give the errors and does reset the data. But you will lose all your input. You can't differentiate correct values from wrong values.

I guess there are more elegant ways to do this, but it works.

J