on 04-16-2008 12:27 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.