cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Date Picker

Former Member
0 Kudos

Hi Experts,

I am using a datePicker(an Input field with Context type Date).

When I am entering any value into that input field and invalidating that it is throwing me an error "Enter the value in the format 11/25/1987".

Is there any other way of invalidating this so that when I enter any invalid value into this input field, it should not throw this errror ?

Most Cordially,

Jay.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All,

The problem i am facing is

I created a context which of type date and i have a inputField

i mapped this context of type date to this inputField .

So that i will get a inputField and date picker

From this date picker if i select a date the selected date will be visible in the inputField.

Instead of this if user enter any text, i am getting the following message "Please give value in form 11/25/1987"

i need to change this messge if user enter any text or invalid date

Thanks

Vijay.

Former Member
0 Kudos

Hi,

By default framework related messages cannot be changed by you.

What you can do is make the attribute bound to this input as calculatted and provide your custom message in the set method.

Regards

Ayyapparaj

Former Member
0 Kudos

Hello Ayyapa Sir,

I have got the same problem in my case. What I understand is to bind the context attribute of type date and to set it;s calculated value as true. But after that you have mentioned that "provide your custom message in the set method" I am unable to understand this thing. Can you please guide me what to do after setting it calculated?

Thanks in advance,

Gaurav

Former Member
0 Kudos

Hi Ayyappa/Jay,

If your requirement is to display date in your own format whenever user selects a date from the calendar.

I have a solution for you.

Whenever user picks a date from Date Picker,you want the date to be displayed in format dd.MM.yyyy

Follow the steps

1)Create a Simple Type(say mydate) of type date in local dictionary.

2)You can see a tab with external format/representation

(I do not remember exactly)

.Click on that enter the format in the input field given as dd.MM.yyyy.

3)Bind your context variable to the above Simple Type(mydate) instead of default date

Now whenever user selects a date it will be displayed in the format mentioned say dd.MM.yyyy

You can also provide any format you required dd/MM/yyyy

etc..ensure MM is capital

Hope it helps

Regards,

Santhosh

former_member201361
Active Contributor
0 Kudos

hi,

the problem is not with the Date Format but with the Error messages with the date picker.

As Ayyaparaj told , the Custom message is thrown by the Framework which cannot be modified by us and for the Calculated Attribute i am not sure but u can refer this link which talks about the setter and getter method

[]

Thanks and regards

Fistae

Former Member
0 Kudos

Hi Kalyan

The problem i am facing is

I created a context which of type date and i have a inputField

i mapped this context of type date to this inputField .

So that i will get a inputField and date picker

From this date picker if i select a date the selected date will be visible in the inputField.

Instead of this if user enter any text, i am getting the following message "Please give value in form 11/25/1987"

i need to change this messge if user enter any text or invalid date

Thanks

Vijay.

Former Member
0 Kudos

Hi Jay,

As far as I understand your problem, you are trying to enter some value in the input field but it's showing an error as the format is wrong but when you select the date from the picker it works.

There's a format of the date which you need to follow it varies for different timezones. In your case the format is mm/dd/yyyy. I suggest you either follow this format and enter date in months/date/year only or you can change the format of the date picker by using the following code:

TimeZone tz = TimeZone.getTimeZone("GMT+05:30");
SimpleDateFormat formatter =(SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.US);
formatter.setTimeZone(tz);
formatter.applyPattern("dd-MMM-yyyy");

Use your pattern for dd-MMM-yyyy and use this code with your date context.

I think this will solve your problem.

Regards,

Gaurav.

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi JayPal

The context attribute of type should be webdynpro java built in type date.In the context attribute properties go to Type property and select date type.Dont take from the dictionary type.If you are not getting incase rebuild the project and deploy it once again.

Regards

Kalyan