Re: [Wicket-user] Custom date component...

2006-10-10 Thread Alexei Sokolov
I noticed that this component uses current date as default value. Is it possible to modify it so if one of the fields is not selected the component fails validation?Thank you,Alex
On 9/8/06, Andrew Lombardi <[EMAIL PROTECTED]> wrote:
On Sep 7, 2006, at 3:09 PM, Erik Brakkee wrote: Andrew Lombardi wrote: 
Erik,  I had similar issues with the DatePicker for various reasons.  After some help from Nick and Igor I built a 3 dropdown component for choosing date similar to what you describe below.  Check out my blog entry for details on it:
  http://www.mysticcoders.com/blog/2006/08/21/datechooser-component-for-wicket/
   Excellent! This is exactly what I need. By the way, I think a component like this should also be part of wicket extensions. There is no need for a one-size-fits all 
date component and in practice you encounter many different types of date choosers. The advantage of the dropdown version over the _javascript_ version in my opinion is that you can use the keyboard and that it doesn't give you a popup and force a user to use the mouse.  An experienced user should be able to use the interface with the keyboard only I think. 
yeah, having it as a secondary option in wicket-extensions might be nice.  I believe I can create a wicket-contrib project with this on it.  Just so its available somewhere
   basically you want to create a DateModel which holds a 
Date object passed in to your component and override getObject to return the appropriate value based on the field you want, MONTH, DAY_OF_MONTH, YEAR. [] 
 I have just read your blog.  I will try it out tomorrow.   validation would probably be easiest just to use some client-side _javascript_.
  Or use the validation support of the FormComponent. I had also looked around a bit and discovered that the problem was that Panel doesn't extend FormComponent. Because of this I was a bit reluctant about writing a component myself because I don't know the APIs for rendering HTML. But I really like your solution. You solved it by implementing the custom component, adding three nested components to it, and then you provide a custom Panel for generating the HTML markup. This is surely an interesting pattern that I would want to use as well. 
good deal :)  Cheers   Erik  
  Cheers,  andrew  On Sep 7, 2006, at 2:29 AM, Erik Brakkee wrote:Hi,
I have tried to use the DatePicker component but somehow it doesn't
really work on Firefox 1.5 on linux. For instance, it only shows theeven years, and has strange behavior resetting fields.
Therefore, I want to write my own date component. Very simple, threedrop down choices for year, month, and day of month respectively. I am
now using a Panel component for this. The problem is here that the stateof my DateChooser is represented by three String fields for year, month,
and day of month, whereas my model is represented as a java.util.Date inthe IModel (PropertyModel).
Now, when I make sure that my DropDownChoice implementation haswantOnSelectionChangedNotification() returning true, I get notified ofevery change and in this callback I can set the model to the appropriate
date by using the three String field values as input. Problem is that ifthe user doesn't change the date, then no date will be set. Furthermore,
a server round-trip is not necessary so I would like to get rid of this.I would like to avoid server round trips, make sure the model is set on
submit of the form, and also I would like to use validation of the date(the day of month could be out of range).  How would I solve this problem?
Cheers  Erik
-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
 
  
To our success!

Andrew Lombardi
:  
Mystic Coders, LLC
 - Coding Magic  
contact | 
[EMAIL PROTECTED]
 - 714-697-8046 | aim - nlpjunke  
This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient.
   -Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&ki

Re: [Wicket-user] Custom date component...

2006-09-08 Thread Andrew Lombardi
On Sep 7, 2006, at 3:09 PM, Erik Brakkee wrote: Andrew Lombardi wrote: Erik,  I had similar issues with the DatePicker for various reasons.  After some help from Nick and Igor I built a 3 dropdown component for choosing date similar to what you describe below.  Check out my blog entry for details on it:  http://www.mysticcoders.com/blog/2006/08/21/datechooser-component-for-wicket/  Excellent! This is exactly what I need. By the way, I think a component like this should also be part of wicket extensions. There is no need for a one-size-fits all date component and in practice you encounter many different types of date choosers. The advantage of the dropdown version over the _javascript_ version in my opinion is that you can use the keyboard and that it doesn't give you a popup and force a user to use the mouse.  An experienced user should be able to use the interface with the keyboard only I think. yeah, having it as a secondary option in wicket-extensions might be nice.  I believe I can create a wicket-contrib project with this on it.  Just so its available somewhere   basically you want to create a DateModel which holds a Date object passed in to your component and override getObject to return the appropriate value based on the field you want, MONTH, DAY_OF_MONTH, YEAR. []  I have just read your blog.  I will try it out tomorrow.   validation would probably be easiest just to use some client-side _javascript_.  Or use the validation support of the FormComponent. I had also looked around a bit and discovered that the problem was that Panel doesn't extend FormComponent. Because of this I was a bit reluctant about writing a component myself because I don't know the APIs for rendering HTML. But I really like your solution. You solved it by implementing the custom component, adding three nested components to it, and then you provide a custom Panel for generating the HTML markup. This is surely an interesting pattern that I would want to use as well. good deal :)  Cheers   ErikCheers,  andrew  On Sep 7, 2006, at 2:29 AM, Erik Brakkee wrote:Hi,I have tried to use the DatePicker component but somehow it doesn'treally work on Firefox 1.5 on linux. For instance, it only shows theeven years, and has strange behavior resetting fields.Therefore, I want to write my own date component. Very simple, threedrop down choices for year, month, and day of month respectively. I amnow using a Panel component for this. The problem is here that the stateof my DateChooser is represented by three String fields for year, month,and day of month, whereas my model is represented as a java.util.Date inthe IModel (PropertyModel).Now, when I make sure that my DropDownChoice implementation haswantOnSelectionChangedNotification() returning true, I get notified ofevery change and in this callback I can set the model to the appropriatedate by using the three String field values as input. Problem is that ifthe user doesn't change the date, then no date will be set. Furthermore,a server round-trip is not necessary so I would like to get rid of this.I would like to avoid server round trips, make sure the model is set onsubmit of the form, and also I would like to use validation of the date(the day of month could be out of range).  How would I solve this problem?Cheers  Erik-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user   To our success!Andrew Lombardi:  Mystic Coders, LLC - Coding Magic  contact | [EMAIL PROTECTED] - 714-697-8046 | aim - nlpjunke  This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient.   -
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642  ___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   -

Re: [Wicket-user] Custom date component...

2006-09-07 Thread Erik Brakkee




Andrew Lombardi wrote:
Erik,
  
  
  I had similar issues with the DatePicker for various reasons. 
After some help from Nick and Igor I built a 3 dropdown component for
choosing date similar to what you describe below.  Check out my blog
entry for details on it:
  
  
  http://www.mysticcoders.com/blog/2006/08/21/datechooser-component-for-wicket/

Excellent! This is exactly what I need. By the way, I think a component
like this should also be part of wicket extensions. There is no need
for a one-size-fits all date component and in practice you encounter
many different types of date choosers. The advantage of the dropdown
version over the _javascript_ version in my opinion is that you can use
the keyboard and that it doesn't give you a popup and force a user to
use the mouse.  An experienced user should be able to use the interface
with the keyboard only I think. 

  
  
  basically you want to create a DateModel which holds a Date
object passed in to your component and override getObject to return the
appropriate value based on the field you want, MONTH, DAY_OF_MONTH,
YEAR.
[]

I have just read your blog.  I will try it out tomorrow.

  validation would probably be easiest just to use some
client-side _javascript_.

Or use the validation support of the FormComponent. I had also looked
around a bit and discovered that the problem was that Panel doesn't
extend FormComponent. Because of this I was a bit reluctant about
writing a component myself because I don't know the APIs for rendering
HTML. But I really like your solution. You solved it by implementing
the custom component, adding three nested components to it, and then
you provide a custom Panel for generating the HTML markup. This is
surely an interesting pattern that I would want to use as well. 

Cheers
  Erik


  
  
  Cheers,
  
  
  andrew
  
  
  On Sep 7, 2006, at 2:29 AM, Erik Brakkee wrote:
  
  
Hi,




I have tried to use the DatePicker
component but somehow it doesn't
really work on Firefox 1.5 on linux. For
instance, it only shows the
even years, and has strange behavior
resetting fields.


Therefore, I want to write my own date
component. Very simple, three
drop down choices for year, month, and
day of month respectively. I am
now using a Panel component for this. The
problem is here that the state
of my DateChooser is represented by three
String fields for year, month,
and day of month, whereas my model is
represented as a java.util.Date in
the IModel (PropertyModel).


Now, when I make sure that my
DropDownChoice implementation has
wantOnSelectionChangedNotification()
returning true, I get notified of
every change and in this callback I can
set the model to the appropriate
date by using the three String field
values as input. Problem is that if
the user doesn't change the date, then no
date will be set. Furthermore,
a server round-trip is not necessary so I
would like to get rid of this.


I would like to avoid server round trips,
make sure the model is set on
submit of the form, and also I would like
to use validation of the date
(the day of month could be out of range).  How would I solve this problem?


Cheers
  Erik


-
Using Tomcat but need to do more? Need to
support web services, security?
Get stuff done quickly with
pre-integrated technology to make your job easier
Download IBM WebSphere Application Server
v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
  
   
  
  
  To our
success!
  
  Andrew
Lombardi:
  Mystic
Coders, LLC
- Coding Magic
  contact
| [EMAIL PROTECTED]
- 714-697-8046 | aim - nlpjunke
  This
message is for the named person's use only. You must not, directly or
indirectly, use, disclose, distribute, print, or copy any part of this
message if you are not the intended recipient.
  
   
  
  
  

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
  

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
  




-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make 

Re: [Wicket-user] Custom date component...

2006-09-07 Thread Andrew Lombardi
Erik,I had similar issues with the DatePicker for various reasons.  After some help from Nick and Igor I built a 3 dropdown component for choosing date similar to what you describe below.  Check out my blog entry for details on it:http://www.mysticcoders.com/blog/2006/08/21/datechooser-component-for-wicket/basically you want to create a DateModel which holds a Date object passed in to your component and override getObject to return the appropriate value based on the field you want, MONTH, DAY_OF_MONTH, YEAR.override setObject to set each field in a Calendar object so that when the form submits, all fields in a Calendar are set one-by-one, and can return a valid date.  The Model's are nice because all you have to do is pass in a Date, and the rest is done.If you search in the feature enhancements on wicket's sf.net page, I believe I submitted the code there.validation would probably be easiest just to use some client-side _javascript_.Cheers,andrewOn Sep 7, 2006, at 2:29 AM, Erik Brakkee wrote:Hi,I have tried to use the DatePicker component but somehow it doesn'treally work on Firefox 1.5 on linux. For instance, it only shows theeven years, and has strange behavior resetting fields.Therefore, I want to write my own date component. Very simple, threedrop down choices for year, month, and day of month respectively. I amnow using a Panel component for this. The problem is here that the stateof my DateChooser is represented by three String fields for year, month,and day of month, whereas my model is represented as a java.util.Date inthe IModel (PropertyModel).Now, when I make sure that my DropDownChoice implementation haswantOnSelectionChangedNotification() returning true, I get notified ofevery change and in this callback I can set the model to the appropriatedate by using the three String field values as input. Problem is that ifthe user doesn't change the date, then no date will be set. Furthermore,a server round-trip is not necessary so I would like to get rid of this.I would like to avoid server round trips, make sure the model is set onsubmit of the form, and also I would like to use validation of the date(the day of month could be out of range).  How would I solve this problem?Cheers  Erik-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user  To our success!Andrew Lombardi: Mystic Coders, LLC - Coding Magiccontact | [EMAIL PROTECTED] - 714-697-8046 | aim - nlpjunkeThis message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. -
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Custom date component...

2006-09-07 Thread Erik Brakkee




Johan Compagner wrote:
you could try to help us with the wicket-contrib-datepicker
which should replace the current datepicker that we have in extentions.

I didn't know about wicket-contrib. The only place I looked was in
wicket-extensions. It doens't appear on the main wicket site. 
Where can I find that? Of course, I am always willing to help if I can
but I am not much of a _javascript_ hacker so I'm not sure if I can help
with the current DataPicker in wicket-extensions.

I don't have any problems with the datepicker in FF15 by the way. What
exactly do you see?
  

Just checked again, and it appears I am using an ancient Firefox
version 1.0.8. Also, it appears to work now. Yesterday I got really
strange behavior. 

Ok, this is a non-issue, except then for the issue of using a Panel as
a FormComponent. I think a FormPanel would be a valuable addition to
wicket. 

Cheers
  Erik

  On 9/7/06, Erik
Brakkee <[EMAIL PROTECTED]>
wrote:
  Hi,


I have tried to use the DatePicker component but somehow it doesn't
really work on Firefox 1.5 on linux. For instance, it only shows the
even years, and has strange behavior resetting fields.

Therefore, I want to write my own date component. Very simple, three

drop down choices for year, month, and day of month respectively. I am
now using a Panel component for this. The problem is here that the state
of my DateChooser is represented by three String fields for year,
month,

and day of month, whereas my model is represented as a java.util.Date in
the IModel (PropertyModel).

Now, when I make sure that my DropDownChoice implementation has
wantOnSelectionChangedNotification() returning true, I get notified of

every change and in this callback I can set the model to the appropriate
date by using the three String field values as input. Problem is that if
the user doesn't change the date, then no date will be set.
Furthermore,

a server round-trip is not necessary so I would like to get rid of this.

I would like to avoid server round trips, make sure the model is set on
submit of the form, and also I would like to use validation of the date

(the day of month could be out of range).  How would I solve this
problem?

Cheers
  Erik

-
Using Tomcat but need to do more? Need to support web services,
security?

Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
  
  

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
  

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
  




-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Custom date component...

2006-09-07 Thread Johan Compagner
you could try to help us with the wicket-contrib-datepickerwhich should replace the current datepicker that we have in extentions.I don't have any problems with the datepicker in FF15 by the way. What exactly do you see?
On 9/7/06, Erik Brakkee <[EMAIL PROTECTED]> wrote:
Hi,I have tried to use the DatePicker component but somehow it doesn'treally work on Firefox 1.5 on linux. For instance, it only shows theeven years, and has strange behavior resetting fields.Therefore, I want to write my own date component. Very simple, three
drop down choices for year, month, and day of month respectively. I amnow using a Panel component for this. The problem is here that the stateof my DateChooser is represented by three String fields for year, month,
and day of month, whereas my model is represented as a java.util.Date inthe IModel (PropertyModel).Now, when I make sure that my DropDownChoice implementation haswantOnSelectionChangedNotification() returning true, I get notified of
every change and in this callback I can set the model to the appropriatedate by using the three String field values as input. Problem is that ifthe user doesn't change the date, then no date will be set. Furthermore,
a server round-trip is not necessary so I would like to get rid of this.I would like to avoid server round trips, make sure the model is set onsubmit of the form, and also I would like to use validation of the date
(the day of month could be out of range).  How would I solve this problem?Cheers  Erik-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user