DateTextField - what am I missing here?
I must be missing something obvious but I can't spot itI'm using a DateTextField (Wicket 1.3.2) in my form like so: Java: DateTextField expiryDate = new DateTextField( expiryDate, new PropertyModel(this, date), new StyleDateConverter(S-, true)); expiryDate.add(new DatePicker()); expiryDate.setRequired(true); codeForm.add(expiryDate); HTML: input type=text wicket:id=expiryDate size=10 / My error: org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: date at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84) at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113) at org.apache.wicket.Component.getModelObject(Component.java:1551) at org.apache.wicket.extensions.yui.calendar.DatePicker.configure(DatePicker.java:367) at org.apache.wicket.extensions.yui.calendar.DatePicker.renderHead(DatePicker.java:208) at org.apache.wicket.Component.renderHead(Component.java:2558) I'm following the example but not sure what this means. Thanks! -- View this message in context: http://www.nabble.com/DateTextField---what-am-I-missing-here--tp17215983p17215983.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DateTextField - what am I missing here?
Assuming EditDiscountCode is a wicket component, given the new PropertyModel(this, date) You probably want to either use an object that has a get/setDate (your model object) or add those methods to your component. Maurice On Tue, May 13, 2008 at 9:04 PM, V. Jenks [EMAIL PROTECTED] wrote: I must be missing something obvious but I can't spot itI'm using a DateTextField (Wicket 1.3.2) in my form like so: Java: DateTextField expiryDate = new DateTextField( expiryDate, new PropertyModel(this, date), new StyleDateConverter(S-, true)); expiryDate.add(new DatePicker()); expiryDate.setRequired(true); codeForm.add(expiryDate); HTML: input type=text wicket:id=expiryDate size=10 / My error: org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: date at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84) at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113) at org.apache.wicket.Component.getModelObject(Component.java:1551) at org.apache.wicket.extensions.yui.calendar.DatePicker.configure(DatePicker.java:367) at org.apache.wicket.extensions.yui.calendar.DatePicker.renderHead(DatePicker.java:208) at org.apache.wicket.Component.renderHead(Component.java:2558) I'm following the example but not sure what this means. Thanks! -- View this message in context: http://www.nabble.com/DateTextField---what-am-I-missing-here--tp17215983p17215983.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DateTextField - what am I missing here?
When you do new PropertyModel(this, expiryDate), this refers to your page EditDiscountCode which does not have get/setExpiryDate. Instead of this you should use the model you also pass to the form which contains a DiscountCode. Maurice On Tue, May 13, 2008 at 11:13 PM, V. Jenks [EMAIL PROTECTED] wrote: I don't know, would it? That's what I'm trying to figure out, the example is very vague. By that logic, I should name pass in expiryDate even though I've already named the field that? I tried: DateTextField expiryDate = new DateTextField( expiryDate, new PropertyModel(this, expiryDate), new StyleDateConverter(S-, true)); expiryDate.add(new DatePicker()); expiryDate.setRequired(true); codeForm.add(expiryDate); ...and it fails: 52560 [httpSSLWorkerThread-80-4] ERROR org.apache.wicket.RequestCycle - No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: expiryDate org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: expiryDate This seems rather cumbersome, calendars worked really well in 1.2...I can't make sense of this. Thanks again... Gwyn wrote: From a very quick look, won't your property model value of date will mean it'll be doing a getDate() not getExpiryDate()? /Gwyn On Tue, May 13, 2008 at 8:38 PM, V. Jenks [EMAIL PROTECTED] wrote: Sorry, I'll clarify, was trying to be as condensed as possible. EditDiscountCode is the name of the page, which inherits WebPage. The model object of the form, which is my DiscountCode entity, does have a getter/setter for the expiryDate field, which is what I showed you in my initial post. @Entity @Table(name=tbl_discount_code) public class DiscountCode implements Serializable { . @Temporal(value=TemporalType.DATE) @Column(nullable=false) private Date expiryDate; . public Date getExpiryDate() { return this.expiryDate; } public void setExpiryDate(Date expiryDate) { this.expiryDate = expiryDate; } } So, I suppose I'm not entirely clear on what you're suggesting? Mr Mean wrote: Assuming EditDiscountCode is a wicket component, given the new PropertyModel(this, date) You probably want to either use an object that has a get/setDate (your model object) or add those methods to your component. Maurice On Tue, May 13, 2008 at 9:04 PM, V. Jenks [EMAIL PROTECTED] wrote: I must be missing something obvious but I can't spot itI'm using a DateTextField (Wicket 1.3.2) in my form like so: Java: DateTextField expiryDate = new DateTextField( expiryDate, new PropertyModel(this, date), new StyleDateConverter(S-, true)); expiryDate.add(new DatePicker()); expiryDate.setRequired(true); codeForm.add(expiryDate); HTML: input type=text wicket:id=expiryDate size=10 / My error: org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: date at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84) at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113) at org.apache.wicket.Component.getModelObject(Component.java:1551) at org.apache.wicket.extensions.yui.calendar.DatePicker.configure(DatePicker.java:367) at org.apache.wicket.extensions.yui.calendar.DatePicker.renderHead(DatePicker.java:208) at org.apache.wicket.Component.renderHead(Component.java:2558) I'm following the example but not sure what this means. Thanks! -- View this message in context: http://www.nabble.com/DateTextField---what-am-I-missing-here--tp17215983p17215983.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: DateTextField - what am I missing here?
this points to current wicket page. So wicket looks for expiryDate in the wicket page. If you declare expiryDate within wicket page, you won't get error message. Otherwise, as suggested by Mr Mean, instead of this you should pass model which has getter/setters for expiryDate. Sanjeev Mr Mean wrote: When you do new PropertyModel(this, expiryDate), this refers to your page EditDiscountCode which does not have get/setExpiryDate. Instead of this you should use the model you also pass to the form which contains a DiscountCode. Maurice On Tue, May 13, 2008 at 11:13 PM, V. Jenks [EMAIL PROTECTED] wrote: I don't know, would it? That's what I'm trying to figure out, the example is very vague. By that logic, I should name pass in expiryDate even though I've already named the field that? I tried: DateTextField expiryDate = new DateTextField( expiryDate, new PropertyModel(this, expiryDate), new StyleDateConverter(S-, true)); expiryDate.add(new DatePicker()); expiryDate.setRequired(true); codeForm.add(expiryDate); ...and it fails: 52560 [httpSSLWorkerThread-80-4] ERROR org.apache.wicket.RequestCycle - No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: expiryDate org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: expiryDate This seems rather cumbersome, calendars worked really well in 1.2...I can't make sense of this. Thanks again... Gwyn wrote: From a very quick look, won't your property model value of date will mean it'll be doing a getDate() not getExpiryDate()? /Gwyn On Tue, May 13, 2008 at 8:38 PM, V. Jenks [EMAIL PROTECTED] wrote: Sorry, I'll clarify, was trying to be as condensed as possible. EditDiscountCode is the name of the page, which inherits WebPage. The model object of the form, which is my DiscountCode entity, does have a getter/setter for the expiryDate field, which is what I showed you in my initial post. @Entity @Table(name=tbl_discount_code) public class DiscountCode implements Serializable { . @Temporal(value=TemporalType.DATE) @Column(nullable=false) private Date expiryDate; . public Date getExpiryDate() { return this.expiryDate; } public void setExpiryDate(Date expiryDate) { this.expiryDate = expiryDate; } } So, I suppose I'm not entirely clear on what you're suggesting? Mr Mean wrote: Assuming EditDiscountCode is a wicket component, given the new PropertyModel(this, date) You probably want to either use an object that has a get/setDate (your model object) or add those methods to your component. Maurice On Tue, May 13, 2008 at 9:04 PM, V. Jenks [EMAIL PROTECTED] wrote: I must be missing something obvious but I can't spot itI'm using a DateTextField (Wicket 1.3.2) in my form like so: Java: DateTextField expiryDate = new DateTextField( expiryDate, new PropertyModel(this, date), new StyleDateConverter(S-, true)); expiryDate.add(new DatePicker()); expiryDate.setRequired(true); codeForm.add(expiryDate); HTML: input type=text wicket:id=expiryDate size=10 / My error: org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: date at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84) at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113) at org.apache.wicket.Component.getModelObject(Component.java:1551) at org.apache.wicket.extensions.yui.calendar.DatePicker.configure(DatePicker.java:367) at org.apache.wicket.extensions.yui.calendar.DatePicker.renderHead(DatePicker.java:208) at org.apache.wicket.Component.renderHead(Component.java:2558) I'm following the example but not sure what this means. Thanks! -- View this message in context: http://www.nabble.com/DateTextField---what-am-I-missing-here--tp17215983p17215983.html Sent from