You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Luther Baker <lu...@gmail.com> on 2009/04/02 17:56:03 UTC

View the Source

I'd like to see how the model implementation (Model, ProeprtyModel,
CompoundPropertyModel) I use affects the DropDownChoice.

I can see the model get SET in the Component when I initially create the
DropDownChoice. What I'd like to see is how, on a subsequent POST, the
parameters I in my form get pushed into that model. I am able to get one
form to work perfectly but another is not populating my model object. i.e.:
in "onSubmit", the id is not being set for one of my cases --- there are
some subtle differencees in the parent Form model but in general, the
examples are very simple and almost dead copies of each other.

So - I wanted to watch the magic ... I am drilling down into
Form.delegateSubmit and I'll keep stepping through but didn't see the model
hydration in my first few runs so wanted to ask here.

Thanks,

-Luther

Re: View the Source

Posted by Luther Baker <lu...@gmail.com>.
>
>
> I use IntelliJ IDEA and I've never had any troubles with my equals()
> and hashCode() methods.
>

That is probably fine 90% of the time but I'd be careful if you're not
actually giving it a bit of thought.

It is actually quite difficult to correctly implement equals in a general,
universal way and since an IDE cannot infer semantics, there are times when
an otherwise standard implementation will need to be adjusted.

It isn't rocket science - but it can be tricky. If you're interested, see
the paper I linked to earlier as well as some of Joshua Bloch's posts on the
topic.

-Luther

Re: View the Source

Posted by James Carman <jc...@carmanconsulting.com>.
On Thu, Apr 2, 2009 at 5:07 PM, Luther Baker <lu...@gmail.com> wrote:
> I recently read this
> http://www.angelikalanger.com/Articles/JavaSolutions/SecretsOfEquals/Equals.htmland
> now, at least for the time being, I take great care when writing
> hashCode, equals and compareTo. It is a good read if you're not already
> familiar with the topic.
>
> For what its worth, I tend to use the apache commons builders
> (HashCodeBuilder, EqualsBuilder and CompareToBuilder) but to your point,
> I'll have to take a look at what Eclipse can do for me.

I use IntelliJ IDEA and I've never had any troubles with my equals()
and hashCode() methods.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: View the Source

Posted by Jeremy Thomerson <je...@wickettraining.com>.
I like the Apache Commons builders with the Eclipse plugin that generates
the methods using them. (CommonClipse)

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, Apr 2, 2009 at 4:07 PM, Luther Baker <lu...@gmail.com> wrote:

> I recently read this
>
> http://www.angelikalanger.com/Articles/JavaSolutions/SecretsOfEquals/Equals.htmland
> now, at least for the time being, I take great care when writing
> hashCode, equals and compareTo. It is a good read if you're not already
> familiar with the topic.
>
> For what its worth, I tend to use the apache commons builders
> (HashCodeBuilder, EqualsBuilder and CompareToBuilder) but to your point,
> I'll have to take a look at what Eclipse can do for me.
>
> -Luther
>
>
> On Thu, Apr 2, 2009 at 2:24 PM, James Carman
> <jc...@carmanconsulting.com>wrote:
>
> > On Thu, Apr 2, 2009 at 3:21 PM, luther.baker <lu...@gmail.com>
> > wrote:
> > > Found my problem. Found the relationship between validation and then
> > model
> > > hydration and finally - that my equals operator was incorrectly
> comparing
> > > (that == that).
> >
> > Don't you generate your equals() methods?  Once I found that nice
> > little feature in my IDE, I've never looked back.  I don't ever write
> > equals() or hashCode() anymore by hand.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: View the Source

Posted by Luther Baker <lu...@gmail.com>.
I recently read this
http://www.angelikalanger.com/Articles/JavaSolutions/SecretsOfEquals/Equals.htmland
now, at least for the time being, I take great care when writing
hashCode, equals and compareTo. It is a good read if you're not already
familiar with the topic.

For what its worth, I tend to use the apache commons builders
(HashCodeBuilder, EqualsBuilder and CompareToBuilder) but to your point,
I'll have to take a look at what Eclipse can do for me.

-Luther


On Thu, Apr 2, 2009 at 2:24 PM, James Carman
<jc...@carmanconsulting.com>wrote:

> On Thu, Apr 2, 2009 at 3:21 PM, luther.baker <lu...@gmail.com>
> wrote:
> > Found my problem. Found the relationship between validation and then
> model
> > hydration and finally - that my equals operator was incorrectly comparing
> > (that == that).
>
> Don't you generate your equals() methods?  Once I found that nice
> little feature in my IDE, I've never looked back.  I don't ever write
> equals() or hashCode() anymore by hand.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: View the Source

Posted by James Carman <jc...@carmanconsulting.com>.
On Thu, Apr 2, 2009 at 3:21 PM, luther.baker <lu...@gmail.com> wrote:
> Found my problem. Found the relationship between validation and then model
> hydration and finally - that my equals operator was incorrectly comparing
> (that == that).

Don't you generate your equals() methods?  Once I found that nice
little feature in my IDE, I've never looked back.  I don't ever write
equals() or hashCode() anymore by hand.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: View the Source

Posted by "luther.baker" <lu...@gmail.com>.

luther.baker wrote:
> 
> I'd like to see how the model implementation (Model, ProeprtyModel,
> CompoundPropertyModel) I use affects the DropDownChoice.
> ...
> 
> 

Found my problem. Found the relationship between validation and then model
hydration and finally - that my equals operator was incorrectly comparing
(that == that).

-Luther

-- 
View this message in context: http://www.nabble.com/View-the-Source-tp22851302p22855222.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org