on 06-16-2008 7:52 AM
Hi,
I have two date field, one is StartDate another is EndDate.
I want to calculate the EndDate once the StartDate is Selected.
Currently, I make use of the "Enter" properties which tag to the calendar (Date input properties). This generate a method in the view controller which allow me to place the calculation of the End Date.
When I select the StartDate from the calendar, it does not trigger the event Enter of the input date properties unless I hit the "ENTER" button of the keyboard. In additional, when I set the endDate, it has runtime error say that the value is not modifiable.
How do I make it such that when I select the desire StartDate (from the input calendar), it will trigger the event to calculate a endDate to display.
Hi,
You can give a try by making the attributes bound to the start date and end date as calculated.
Do your enddate calculation inside the setter of the beginDate.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What you can try is create a calculated attribute lets say StartDate of type Date and set the readOnly property false.
Once this is done you will get a method as follows
public void setStartDate(IPrivateTestCompView.IContextElement element, java.sql.Date value)
{
//@@begin setStartDate
//accesing the EndDate and assigning startdate+10 as the value
final Calendar calendar = new GregorianCalendar();
calendar.setTime(value);
calendar.add(Calendar.DATE, 10);
element.setEndDate(new Date(calendar.getTime().getTime()))
//@@end
}
Regards
Ayyapparaj
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.