on 09-08-2006 11:56 AM
hi
I have a text box with date on it ,i have another text box ,i want that when user select a date on my previous text box ,the week of the day of that particular date selected is displayed.
For e.g date selected is 08/09/2006in one text box and automatically on other text box Friday comes.
Regards
Nidhideep
Hi,
Date datefromInputField = ....;
SimpleDateFormat df = new SimpleDateFormat("EEEE");
String s = df.format(datefromInputField );
// s is now equal to the day of week
Regards
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
Sebastain ,I have made an action selectday bind it to the UI element order date of type date:
onselectday(){
Date orderdate = wdContext.currentcontextelement.order_date();
SimpleDateFormat df = new SimpleDateFormat("EEEE");
String s = df.format(orderdate);
//now setting my text box which will show day
wdContext.currentContextelement.setBox(s);
but the desired result is not coming
Plz help me
Regards
Nidhideep
Hi,
The statement, Date orderdate = wdContext.currentcontextelement.order_date(); is it typed by you? it will give error.
Date orderdate = wdContext.currentContextElement().getOrder_date();
and instead of wdContext.currentContextelement.setBox(s);
use wdContext.currentContextElement().setBox(s);
Hi
This Code Working Fine
Date date = wdContext.currentContextElement().getTestDate();
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("EEEEEEEE");
String wd=sdf.format(date);
wdComponentAPI.getMessageManager().reportSuccess(wd);
wdContext.currentContextElement().setBox(wd);
Check that the event is call the function
Kind Regards
Mukesh
Hi,
There is no action tiggered when you click the calendar of the Date input field.
but you can write action for the textbox(ie., press ENTER Key).
try this code,
Date dateNow=wdContext.currentContextElement().get<DateofText1>();
int dayNo=dateNow.getDay(); //returns the day of the week
switch(dayNo)
{
case 0: wdcontext.currentContextElement().set<DateofText2("Monday");
break;
case 1: wdcontext.currentContextElement().set<DateofText2("Tuesday");
break;
.
.
.
up to case 6:
}
regards
karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nidhideep
Use SimpleDateFormat for this.
SimpleDateFormat sdf = new SimpleDateFormat("EEEEEE");
String weekday = sdf.format(<pass the date>);
Use string attribute Weekday and attach with other textbox.
wdContext.currentContextElement().setWeekday(weekday);
Do this on the action of user selecting the date.
I hope it helps
Thanks
Srikant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.