Author |
Message |
13/01/2009 21:44:59
|
gtuerk
Active
Joined: 12/01/2009 22:03:24
Messages: 14
Offline
|
Hi,
I would like to use the component CALENDARFIELD for an analysis webpage. Therefore, it would be useful to have the possibility to set “minDate” and “maxDate” or at least “no future” (and maybe for other pages also “no past”) for the analysis period that can be chosen with the help of the component.
Can these restrictions be set for inputs in the mentioned component?
|
|
|
13/01/2009 22:55:46
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5526
Offline
|
Hi,
the CALENDARFIELD (currently) does not know about restrictions directly within the client processing.
Consequently you need to check in your server side bean processing. Set the attribute CALENDARFIELD-FLUSH, so that user input in this component automatically causes a server communication. Implement the CALENDARFIELD-ACTIONLISTENER and check for the event type "BaseActionEventFlush". You may use CALENDARFIELD-BGPAINT and set it to "error()" in case of wrong input (by binding CALENDARFIELD-BGPAINT to a corresponding property).
We will think about adding a min/maxvalue to CALENDARFIELD....
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
14/01/2009 07:45:46
|
gtuerk
Active
Joined: 12/01/2009 22:03:24
Messages: 14
Offline
|
Hi,
thank you for this information.
G. Türk
|
|
|
14/01/2009 15:48:07
|
gtuerk
Active
Joined: 12/01/2009 22:03:24
Messages: 14
Offline
|
Is alternatively the usage of JSF-validators within the jsp-definition possible?
Because I've got only an exception when I tried to use validators in the Enterprise Client.
G. Türk
|
|
|
14/01/2009 15:51:30
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5526
Offline
|
...no, validators are not supported - please directly check within the managed bean processing.
Björn
PS: we could start discussion why we did not fall in love with validators, but that's a different thread...
|
Björn Müller, CaptainCasa GmbH |
|
|
11/05/2009 19:56:07
|
gtuerk
Active
Joined: 12/01/2009 22:03:24
Messages: 14
Offline
|
Hi Björn,
thank you for adding the new attributes toDate and fromDate in the calendarfield. It works fine. Only the last day according to the property "toDate" is shown in the wrong color and the cursor-type is wrong - like for days you aren't allowed to select (attached picturefile), however it can be selected. Would be nice if this "problem" could be solved. Thanks.
Filename |
Calendarfield.JPG |
Download
|
Description |
Calendarfields |
Filesize |
12 Kbytes
|
Downloaded: |
411 time(s) |
|
|
|
12/05/2009 06:13:48
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5526
Offline
|
Hi,
I believe this has to do with the values that are sent up in your example. The frontend color decision is...:
Code:
if (dayCal.getTime().getTime() < m_fromdate || dayCal.getTime().getTime() > m_todate)
{
db.setForeground(Color.gray);
db.setEnabled(false);
}
So, I believe it's the ugly hours and minutes that make things confusing, a bit...: if you send a date "06.10.2009 10:51:222" to the CALENDARFIELD then the component will only change the date part of the time, and not the time part.
In your example - I assume... - the to-date-restriction is "06.10.2009 10:51:222" and the current date-value you pass is "xx.xx.xxxx 10:55:000". I.e. the minute/seconds/milliseconds play a role.
Could this be possible?
Björn
PS: ...dealing with day-dates is a bit ugly in Java from my personal opinion...
|
Björn Müller, CaptainCasa GmbH |
|
|
12/05/2009 18:34:54
|
gtuerk
Active
Joined: 12/01/2009 22:03:24
Messages: 14
Offline
|
Hi,
yes, but the comparison doesn't follow any defined Date-Pattern (dd.MM.yyyy), when only the day but no time should be selected.
|
|
|
|