[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Calendarfield - restrictions on input values  XML
Forum Index -> Development
Author Message
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?
CaptainCasa

Power User
[Avatar]

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
gtuerk

Active

Joined: 12/01/2009 22:03:24
Messages: 14
Offline

Hi,

thank you for this information.

G. Türk
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
CaptainCasa

Power User
[Avatar]

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
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 [Disk] Download
 Description Calendarfields
 Filesize 12 Kbytes
 Downloaded:  411 time(s)

CaptainCasa

Power User
[Avatar]

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
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.
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team