on 08-27-2009 6:29 AM
Hello All,
I want to use java.util.Date in View Context and in Custom Control Context of Web dynpro java. When i mapped of a Input Field to the java.util.Date then message shows that its not supported. Plz suggest me how to handle Date with different formats ??
If you always want the user to enter the date in dd/MM/yyyy, you can do the following.
Goto Local Dictonary -> Simple types in your project and create a type known as "InputDate" (or whatever you feel) of built-in type 'Date'.
Now specifiy its format in the 'Representation' tab as "dd/MM/yyyy" (case-senstive).
Now declare a value attribute say "inputdate" in your context with this type and bind the inputfield to this context value attribute.
This will solve your problem.
But if you want the user to input date depending on the region he belongs, change the default locale date in Control Panel->Regional and Language Options->Change to English(UK) -> Customize -> Date Tab -> Sort Date Format to dd/MM/yyyy.
Now clear the cache, delete temporary files and restart the machine. This should solve the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
For using date format in WebDynpro,you need to take attribute as date not util.date.(type of the input field as date)
After that in coding fr storing teh values in db you need to use the dtae formatter and parse the string and send ,the formatter will be of java.util.Date).
Just try once and lemme kno i can provide you code snippet or else you can get on sdn itself.
Regards,
Anu
Hi ,
For using date format in WebDynpro,you need to take attribute as date not util.date.(type of the input field as date)
After that in coding fr storing teh values in db you need to use the dtae formatter and parse the string and send ,the formatter will be of java.util.Date).
Just try once and lemme kno i can provide you code snippet or else you can get on sdn itself.
Regards,
Anu
Hi
Create a simple data type "DateFormat" in Local Dictionary section of Webdynpro explorer and map the Type property of context attribute to this simple data type.Open the Simple Data type and in the Representation tab of Simple data type you can mention any format(dd.MM.yyyy) and in the Definition tab select the "built in type" as date.
So when you use the context attribute in the code , it will ask you to import the Date package.Select import java.util.Date.
Thanks
Susmita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.