cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Date type checking

Former Member
0 Kudos

Hi!

How can I disable Date type checking that is done by Web Dynpro?

Here what happens is...

When I enter some garbage value on the Date field.. say "abcdef"

The WD prompts a message in that UI element saying ..."The date format should be 11/25/1987"...

and none of the other round trips to the server happen ...... unless I clear the garbage value I entered in the Date field.

As the WD doesn't allow me to work on other UI elements when a garbage value is entered......

So I want to remove the WD Date type checking and add my own validation and type checking on the Date field.

How can I do that?

Please Help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you want to move to other UI elements or if you want to cancel this operation you need to create a non validating action.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj,

I tried non-validating action.

But still it doesn't work.

Thanks for the reply.

Answers (3)

Answers (3)

Former Member
0 Kudos

I have written my Date validation and type checking logic.

It works only sometimes.

There are 2 input fields, 1 for accepting String value "User ID" and the other for "Date".

On submit I have written a logic to check if the "User ID" field is blank?

and for the Date field I have written a logic to check if it is a valid Date.

I am using Message Manager's reportContextAttributeMessage() method for displaying errors in the input field itself.

____________

SITUATION 1:

Consider:

Name: p78
Date: afafaf (some garbage value)

On Submit, It shows error message that i have written "Enter date in the format MM/dd/yyyy" ...on the Date Input field.

Ok. This is fine... as expected.

____________

SITUATION 2:

Consider:

Name: 	(left bank)
Date: 02/18/2009

On Submit, It shows error message on the Name Input field. Ok. This is fine... as expected.

Now, After correction, say I enter

Name: p78
Date: afafaf (some garbage value)

On submit, It shows WD error message on the Date Input field..."Enter the date in the following format: 11/25/1987" but doesn't show the message that I have written.

I am confused. Please help.

chander_kararia4
Contributor
0 Kudos

Hi

Instead of using Date Picker, you can use date navigator. Here by default, the input field will be of type string. So, you can modify the validations & apply them as you wish.

Regards

Chander Kararia

# Please close the thread once get the correct answer. Give rewards for answers.

Former Member
0 Kudos

Hi!

I want a Date Picker from which the user can choose.

Thanks for the suggestion.

chander_kararia4
Contributor
0 Kudos

Hi p78,

Date navigator also works the same way as date picker.

You will find the calendar icon, calendar beside the input field. But, what is the difference is that

you won't find that exception in this case that your getting in by using Date Picker.

I faced the same issue in my application & used the customized Date Navigator to overcome the system generated exceptions.

Regards

Chander Kararia

# Please close the thread once get the correct answer. Give rewards for answers.

Former Member
0 Kudos

hi!

The Date Navigator will not come as a drop down in the input field like Date Picker.. I am right?

chander_kararia4
Contributor
0 Kudos

Hi,

It will come as EXACTLY SAME as that of the date picker. I assure you because I used the same in my project as the client was insisted on 2 things, a) removing the Date Picker UI standard exception & b) Using Date Picker as Date Navigator was a little different UI.

What I have done is: I created a seperate window & View. The new view contains only the Date Navigator. The size of the view was reduced exactly to Date Navigator Calendar & also its position to open on click of calendar icon was set as that of Date Picker.

So, there was input field (type String), Calendar Icon (Type LinktoAction)

You can set as many validation as you require & moreover with your customized error messages.

When the user will click on the calendar icon, the new iview will popup on the screen (it will be exactly same as normal date picker calendar). The user will select the date on calendar. On "Onclick" action of the date navigator, return the controls back to the original iview & make the calendar invisibile.

That's it. Problem solved.

-


Regarding your current issue -

I hope when the error comes first time, it works fine but fails from the next time onwards. Try to invalidate all the nodes incase of the wrong input. Call your doInit() method again with the other name. That Should work.

-


Regards

Chander Kararia

# Please close the thread once get the correct answer. Give rewards for answers.

Edited by: Chander Kararia on Feb 18, 2009 3:51 PM

Former Member
0 Kudos

Regarding my current issue-

The point is when WD sees:

1) invalid Date format... then again invalid Date format -> it shows Customized error message.. (As expected)

2) correct Date format... then invalid Date format -> it shows WD standard error message. (Unusual)

I can't invalidate all the nodes... because..then the other inputs that the user has entered will get wiped off.

______________________________________________________________________________________

If the Date Picker issue doesn't get resolved...

then I'll try out your solution and revert to you soon.

Thanks a lot.

former_member197348
Active Contributor
0 Kudos

Hi,

Some data types have default validations which are carried out by the WD framework.

So you can try like this:

Create a String attribute and bind it to the date input field. Do your validations.

Whenever you want to pass the data ou can set your original Date attribute like this:

wdContext.currentContextElement().set<youroriginaldateattrib>(new Date(wdContext.currentContextElement().get<yourstringdateattrib>) );

Regards,

Siva

Former Member
0 Kudos

Hey Siva,

Thank you for the reply.

So this what I understood... the UI element will accept string values and then I can do validation for Date in the code.

But if the UI element can accept string value... then there won't be any Date picker?