on 06-05-2005 6:31 AM
Hello,
At htmlb and in many SAP apps there is the following UI:
An input field with a little square besides it. Pressing the suqare opens date navigator and selecting a certain date sets it inside the input field. Is there such a ready-made UI at DynPro as well?
Roy
Hi,
Create a context attribute of type "date" and assign the context to a inputfield.
During runtime automatically you will get a dropdown where you can navigate through a calender.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
error in posting....
Message was edited by: Bharathwaj R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go to browser settings , Tools -> Internet Options -> Languages .
Here set the language to English - United Kingdom.
In your code
SimpleDateFormat SDF = new SimpleDateFormat();
wdContext.currentContextElement().setDt(Date.valueOf("1900-2-23"));
You can use this if u have this standard format.
Otherwise..
SimpleDateFormat SDF = new SimpleDateFormat(<"the format of date">);
wdContext.currentContextElement().setDt(SDF.parse("the string date"));
Extremely sorry ! Forget to mention that Dt is of type java.sql.Date...
Regards
Bharathwaj
Message was edited by: Bharathwaj R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roy,
Your requirement being to set the value for the date input field.. you cant do that in the code level.
If you want the value in the input field to displayed in dd\mm\yyyy format switch ur browser language to English-UK.
(I dont know if their is any language setting which gives date in the format of dd\mm\yy).
You cant create a date object in the format you want. You can only parse the object and get it into a formatted string to suit ur requirement
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
java.sql.Date d = new Date(System.currentTimeMillis());
wdComponentAPI.getMessageManager().reportWarning(""+d);
SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yy");
wdComponentAPI.getMessageManager().reportWarning(sdf.format(d));
This will give you the system date in dd/mm/yy format.
Is that wat u want ?
oops ! sorry ! I think u want the dd/mm//yy string as a java.sql.Date ?? Just tell me if i my understanding of your question is correct ?
Regards
Bharathwaj
Message was edited by: Bharathwaj R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I feel for this create a simpleType of type date and set the representaion as per the requirement.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roy,
Th Date Picker takes the format from the ur Browser Settings .That is the reason even if u set the format in the representaion of the simple type ur r still getting the same.
If u change the LanguagePreference from English-US to English-UK.It will show dd/mm/yyyy format.
Regards,
Sowjanya.
Hi ,
I think it is not possible with current versions bcoz if
u set the properties to disable the input field the date picker will also get disabled.
Even if teh user enters in a wrong format in the input field the error handling in webdynpro will throw an error to enter the correct format.
Regards,
Sowjanya.
Hi
Just Check whether this is useful for you
java.sql.Date dt = new java.sql.Date(System.currentTimeMillis());
SimpleDateFormat sdfinput = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfout = new SimpleDateFormat("dd/MM/yyyy");
Date dt1 = null;
try {
dt1 = sdfinput.parse(dt.toString());
String str = sdfinput.format(dt1).toString();
System.out.println(str);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
sdfout.format(dt1);
System.out.println(sdfout.format(dt1));
10X Guys but these won't help.
If you'll notice, DynPro is using java.sql.Date and there is no way, as far as I know, to use the parse on this Object.
krish, in your code for example I need dt1 to be java.sql.Date and not java.util.Date.
To summerise, I need to create an Object from type java.sql.Date that contains today's date in this format: dd/mm/yy. Any idea how to acheive this?
Roy
For my knowldege the user can only select the date from the list and he can't enter any values in the inputfield.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.