Re: DatePicker to pick a year
Thanks, I'll try it. On Fri, Dec 10, 2010 at 4:02 AM, Nivedan Nadaraj wrote: > So I am guessing your model is of TemporalType.Date and If it is the case > and if your not yet resolved it, can you try changing the dateformat to > mm-dd-yy ? or dd-mm-yy ? And see if your getting the validation error. If > your not then DatePicker field is expecting that default format and to > override it I guess Julien's suggestion would be the way to go. > Cheers > > > On Fri, Dec 10, 2010 at 4:53 PM, Nivedan Nadaraj wrote: > >> So did that work? Have you tried to check your model annotation? >> >> >> >> On Wed, Dec 8, 2010 at 10:24 PM, Anna Simbirtsev >> wrote: >> >>> It is a pure Date. >>> >>> On Tue, Dec 7, 2010 at 9:24 PM, nivs wrote: >>> > >>> > Hi >>> > >>> > If your getting the date format error from the Model side and it is >>> > expecting a timestamp , then you might get that issue. >>> > Are you using a TimeStamp field or pure date? >>> > >>> > If I wanted only to store date in the backend without timestamp details >>> my >>> > model has to be decorated like >>> > >>> > @Temporal(TemporalType.DATE) //This is important >>> > @Column(name = "DATE_OF_APPLICATION", length = 7) >>> > public Date getDateOfApplication() { >>> > return this.dateOfApplication; >>> > } >>> > >>> > If for instance it was >>> > @Temporal(TemporalType.TIMESTAMP) >>> > >>> > It will fail validation based on the format. >>> > >>> > Hope that helps >>> > Cheers >>> > >>> > >>> > >>> > >>> > -- >>> > View this message in context: >>> http://apache-wicket.1842946.n4.nabble.com/DatePicker-to-pick-a-year-tp3063856p3077604.html >>> > Sent from the Users forum mailing list archive at Nabble.com. >>> > >>> > - >>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> > For additional commands, e-mail: users-h...@wicket.apache.org >>> > >>> > >>> >>> >>> >>> -- >>> Anna Simbirtsev >>> (416) 729-7331 >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> > -- Anna Simbirtsev (416) 729-7331 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
So I am guessing your model is of TemporalType.Date and If it is the case and if your not yet resolved it, can you try changing the dateformat to mm-dd-yy ? or dd-mm-yy ? And see if your getting the validation error. If your not then DatePicker field is expecting that default format and to override it I guess Julien's suggestion would be the way to go. Cheers On Fri, Dec 10, 2010 at 4:53 PM, Nivedan Nadaraj wrote: > So did that work? Have you tried to check your model annotation? > > > > On Wed, Dec 8, 2010 at 10:24 PM, Anna Simbirtsev wrote: > >> It is a pure Date. >> >> On Tue, Dec 7, 2010 at 9:24 PM, nivs wrote: >> > >> > Hi >> > >> > If your getting the date format error from the Model side and it is >> > expecting a timestamp , then you might get that issue. >> > Are you using a TimeStamp field or pure date? >> > >> > If I wanted only to store date in the backend without timestamp details >> my >> > model has to be decorated like >> > >> > @Temporal(TemporalType.DATE) //This is important >> > @Column(name = "DATE_OF_APPLICATION", length = 7) >> > public Date getDateOfApplication() { >> >return this.dateOfApplication; >> > } >> > >> > If for instance it was >> > @Temporal(TemporalType.TIMESTAMP) >> > >> > It will fail validation based on the format. >> > >> > Hope that helps >> > Cheers >> > >> > >> > >> > >> > -- >> > View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/DatePicker-to-pick-a-year-tp3063856p3077604.html >> > Sent from the Users forum mailing list archive at Nabble.com. >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > For additional commands, e-mail: users-h...@wicket.apache.org >> > >> > >> >> >> >> -- >> Anna Simbirtsev >> (416) 729-7331 >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >
Re: DatePicker to pick a year
So did that work? Have you tried to check your model annotation? On Wed, Dec 8, 2010 at 10:24 PM, Anna Simbirtsev wrote: > It is a pure Date. > > On Tue, Dec 7, 2010 at 9:24 PM, nivs wrote: > > > > Hi > > > > If your getting the date format error from the Model side and it is > > expecting a timestamp , then you might get that issue. > > Are you using a TimeStamp field or pure date? > > > > If I wanted only to store date in the backend without timestamp details > my > > model has to be decorated like > > > > @Temporal(TemporalType.DATE) //This is important > > @Column(name = "DATE_OF_APPLICATION", length = 7) > > public Date getDateOfApplication() { > >return this.dateOfApplication; > > } > > > > If for instance it was > > @Temporal(TemporalType.TIMESTAMP) > > > > It will fail validation based on the format. > > > > Hope that helps > > Cheers > > > > > > > > > > -- > > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/DatePicker-to-pick-a-year-tp3063856p3077604.html > > Sent from the Users forum mailing list archive at Nabble.com. > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > -- > Anna Simbirtsev > (416) 729-7331 > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: DatePicker to pick a year
It is a pure Date. On Tue, Dec 7, 2010 at 9:24 PM, nivs wrote: > > Hi > > If your getting the date format error from the Model side and it is > expecting a timestamp , then you might get that issue. > Are you using a TimeStamp field or pure date? > > If I wanted only to store date in the backend without timestamp details my > model has to be decorated like > > @Temporal(TemporalType.DATE) //This is important > @Column(name = "DATE_OF_APPLICATION", length = 7) > public Date getDateOfApplication() { > return this.dateOfApplication; > } > > If for instance it was > @Temporal(TemporalType.TIMESTAMP) > > It will fail validation based on the format. > > Hope that helps > Cheers > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/DatePicker-to-pick-a-year-tp3063856p3077604.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Anna Simbirtsev (416) 729-7331 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
Hi If your getting the date format error from the Model side and it is expecting a timestamp , then you might get that issue. Are you using a TimeStamp field or pure date? If I wanted only to store date in the backend without timestamp details my model has to be decorated like @Temporal(TemporalType.DATE) //This is important @Column(name = "DATE_OF_APPLICATION", length = 7) public Date getDateOfApplication() { return this.dateOfApplication; } If for instance it was @Temporal(TemporalType.TIMESTAMP) It will fail validation based on the format. Hope that helps Cheers -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DatePicker-to-pick-a-year-tp3063856p3077604.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
Hi Anna, I think you have to set the right converter on your wicket textfield (with the override of the method getConverter and with the class PatternDateConvert). The "dateFormat" option works only on the client side with jQuery. Regards Julien Roche On Tue, Dec 7, 2010 at 7:56 PM, Anna Simbirtsev wrote: > Hi, > > I am using the wiQuery for the calendar now, but have some problems. > > 1) The page refreshes when I click in the field, then the datepicker > appeares. > > 2) When I try to submit, it gives me an error: '1980-12-04' is not a valid > Date. > > > DatePicker datefield = new DatePicker("datefield", Date.class); >datefield.setYearRange(new DatePickerYearRange(new > Short("-210"), new Short("0"))); >datefield.setDateFormat("yy-mm-dd"); >datefield.setChangeYear(true); >datefield.setChangeMonth(true); >datefield.setShowOn(ShowOnEnum.FOCUS); >add(datefield); > > > In the model object, datefield is a Date type. > > Thanks > Anna > > > On Tue, Nov 30, 2010 at 11:20 AM, Alexander Monakhov > wrote: > > Hi. > > > > Why don't you use wiQuery? > > > > BTW, it's not a good idea to set markup id, because you're not sure > > whether it's unique across entire page. Let it be set by framework. > > > > If you don't want to use wiQuery, use header contribution to inject > > jquery related code from java code to page. In this case you can use > > getMarkupId() to retrieve actual input's id and put it to jquery > > related code. > > > > Best regards, Alexander. > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > -- > Anna Simbirtsev > (416) 729-7331 > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: DatePicker to pick a year
Hi, I am using the wiQuery for the calendar now, but have some problems. 1) The page refreshes when I click in the field, then the datepicker appeares. 2) When I try to submit, it gives me an error: '1980-12-04' is not a valid Date. DatePicker datefield = new DatePicker("datefield", Date.class); datefield.setYearRange(new DatePickerYearRange(new Short("-210"), new Short("0"))); datefield.setDateFormat("yy-mm-dd"); datefield.setChangeYear(true); datefield.setChangeMonth(true); datefield.setShowOn(ShowOnEnum.FOCUS); add(datefield); In the model object, datefield is a Date type. Thanks Anna On Tue, Nov 30, 2010 at 11:20 AM, Alexander Monakhov wrote: > Hi. > > Why don't you use wiQuery? > > BTW, it's not a good idea to set markup id, because you're not sure > whether it's unique across entire page. Let it be set by framework. > > If you don't want to use wiQuery, use header contribution to inject > jquery related code from java code to page. In this case you can use > getMarkupId() to retrieve actual input's id and put it to jquery > related code. > > Best regards, Alexander. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Anna Simbirtsev (416) 729-7331 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
Hi. Why don't you use wiQuery? BTW, it's not a good idea to set markup id, because you're not sure whether it's unique across entire page. Let it be set by framework. If you don't want to use wiQuery, use header contribution to inject jquery related code from java code to page. In this case you can use getMarkupId() to retrieve actual input's id and put it to jquery related code. Best regards, Alexander. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
Hi, it's better if you set the id of the input in the java code. Something like: yourinput.setOutpuMarkUpId(true); yourinput.setMarkUpId("mydatepicker"); //i' don't remember exactly the name of the function, but it's something similar bye Luca Il 30/11/2010 16:40, Anna Simbirtsev ha scritto: > Hi, > > I am trying to use JQuery calendar instead, because I like that it has > month and year dropdowns. > > I added js, css and images files. > > Added this to the head: > > $(document).ready(function() { > $("#mydatepicker").datepicker(); > $( "#mydatepicker" ).datepicker({ changeMonth: true, changeYear: true }); > }); > > This is in the body: > > id="mydatepicker" value=""/> > > But it does not work, does anybody has any ideas? > > Thanks > > On Mon, Nov 29, 2010 at 1:07 PM, Anna Simbirtsev > wrote: >> That works, thanks. I just wonder how users will be able to figure it out. >> >> On Mon, Nov 29, 2010 at 11:56 AM, Marco Mancini >> wrote: >>> in this page the problem is dateformat... but he can switch year >>> https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846200#action_12846200 >>> >>> >>> >>> try to click on month name for change year! >>> >>> >>> >>> 2010/11/29 Anna Simbirtsev >>> It does not work, only can switch between month, not year. On Mon, Nov 29, 2010 at 11:33 AM, Marco Mancini wrote: > try this code: > > DatePicker mydp= new DatePicker(){ >private static final long serialVersionUID = 1L; > >@Override >protected boolean enableMonthYearSelection() { >return true; >} >}; > > 2010/11/29 Anna Simbirtsev > >> Hi, >> >> Is it possible to get datapicker to switch between year, currently >> there are arrows to only switch between month? >> >> Thanks, >> Anna >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> -- Anna Simbirtsev (416) 729-7331 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> -- >> Anna Simbirtsev >> (416) 729-7331 >> > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
Hi, I am trying to use JQuery calendar instead, because I like that it has month and year dropdowns. I added js, css and images files. Added this to the head: $(document).ready(function() { $("#mydatepicker").datepicker(); $( "#mydatepicker" ).datepicker({ changeMonth: true, changeYear: true }); }); This is in the body: But it does not work, does anybody has any ideas? Thanks On Mon, Nov 29, 2010 at 1:07 PM, Anna Simbirtsev wrote: > That works, thanks. I just wonder how users will be able to figure it out. > > On Mon, Nov 29, 2010 at 11:56 AM, Marco Mancini wrote: >> in this page the problem is dateformat... but he can switch year >> https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846200#action_12846200 >> >> >> >> try to click on month name for change year! >> >> >> >> 2010/11/29 Anna Simbirtsev >> >>> It does not work, only can switch between month, not year. >>> >>> On Mon, Nov 29, 2010 at 11:33 AM, Marco Mancini >>> wrote: >>> > try this code: >>> > >>> > DatePicker mydp= new DatePicker(){ >>> > private static final long serialVersionUID = 1L; >>> > >>> > �...@override >>> > protected boolean enableMonthYearSelection() { >>> > return true; >>> > } >>> > }; >>> > >>> > 2010/11/29 Anna Simbirtsev >>> > >>> >> Hi, >>> >> >>> >> Is it possible to get datapicker to switch between year, currently >>> >> there are arrows to only switch between month? >>> >> >>> >> Thanks, >>> >> Anna >>> >> >>> >> - >>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> >> For additional commands, e-mail: users-h...@wicket.apache.org >>> >> >>> >> >>> > >>> >>> >>> >>> -- >>> Anna Simbirtsev >>> (416) 729-7331 >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> > > > > -- > Anna Simbirtsev > (416) 729-7331 > -- Anna Simbirtsev (416) 729-7331 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
That works, thanks. I just wonder how users will be able to figure it out. On Mon, Nov 29, 2010 at 11:56 AM, Marco Mancini wrote: > in this page the problem is dateformat... but he can switch year > https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846200#action_12846200 > > > > try to click on month name for change year! > > > > 2010/11/29 Anna Simbirtsev > >> It does not work, only can switch between month, not year. >> >> On Mon, Nov 29, 2010 at 11:33 AM, Marco Mancini >> wrote: >> > try this code: >> > >> > DatePicker mydp= new DatePicker(){ >> > private static final long serialVersionUID = 1L; >> > >> > �...@override >> > protected boolean enableMonthYearSelection() { >> > return true; >> > } >> > }; >> > >> > 2010/11/29 Anna Simbirtsev >> > >> >> Hi, >> >> >> >> Is it possible to get datapicker to switch between year, currently >> >> there are arrows to only switch between month? >> >> >> >> Thanks, >> >> Anna >> >> >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> > >> >> >> >> -- >> Anna Simbirtsev >> (416) 729-7331 >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > -- Anna Simbirtsev (416) 729-7331 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
in this page the problem is dateformat... but he can switch year https://issues.apache.org/jira/browse/WICKET-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846200#action_12846200 try to click on month name for change year! 2010/11/29 Anna Simbirtsev > It does not work, only can switch between month, not year. > > On Mon, Nov 29, 2010 at 11:33 AM, Marco Mancini > wrote: > > try this code: > > > > DatePicker mydp= new DatePicker(){ > >private static final long serialVersionUID = 1L; > > > >@Override > >protected boolean enableMonthYearSelection() { > >return true; > >} > >}; > > > > 2010/11/29 Anna Simbirtsev > > > >> Hi, > >> > >> Is it possible to get datapicker to switch between year, currently > >> there are arrows to only switch between month? > >> > >> Thanks, > >> Anna > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > >> > > > > > > -- > Anna Simbirtsev > (416) 729-7331 > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: DatePicker to pick a year
It does not work, only can switch between month, not year. On Mon, Nov 29, 2010 at 11:33 AM, Marco Mancini wrote: > try this code: > > DatePicker mydp= new DatePicker(){ > private static final long serialVersionUID = 1L; > > �...@override > protected boolean enableMonthYearSelection() { > return true; > } > }; > > 2010/11/29 Anna Simbirtsev > >> Hi, >> >> Is it possible to get datapicker to switch between year, currently >> there are arrows to only switch between month? >> >> Thanks, >> Anna >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > -- Anna Simbirtsev (416) 729-7331 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker to pick a year
try this code: DatePicker mydp= new DatePicker(){ private static final long serialVersionUID = 1L; @Override protected boolean enableMonthYearSelection() { return true; } }; 2010/11/29 Anna Simbirtsev > Hi, > > Is it possible to get datapicker to switch between year, currently > there are arrows to only switch between month? > > Thanks, > Anna > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
DatePicker to pick a year
Hi, Is it possible to get datapicker to switch between year, currently there are arrows to only switch between month? Thanks, Anna - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org