Are you able to use a debugger to see what's being compared by the PropertySelection? It uses Java object identity as a first comparison, so from your usage, the objects' equals() methods may not even be involved.
I'm wondering if you've made a mistake in your IPropertySelectionModel. Option, label and value are easy to mix up. The IPropertySelectionModel Javadocs refer to the first of those as 'option value', which doesn't help. (The options are the underlying objects which are used by the comparison, and label and value are used in the HTML.) Michael -----Original Message----- From: Jason Dyer [mailto:[EMAIL PROTECTED] Sent: January 11, 2006 3:13 PM To: [email protected] Subject: problem with PropertySelection + Hibernate I'm confused by an issue I'm having with PropertySelection and Hibernate, so I'd appreciate any insight into the problem. Basically, I've got Hibernate and Tapestry playing together at least as much as I've been able to display and update data using the OpenSessionInView model as supported by hive-util (aka hivetranse.) So far, so good, until I tried to create a PropertySelction component defined as: <component id="standingSelect" type="PropertySelection"> <binding name="displayName" value="literal:Standing"/> <binding name="value" value="ognl:customer.standing"/> <binding name="model" value="ognl:customerStandingSelectionModel"/> </component> where customer.standing is an object of type Standing, which should be loaded by Hibernate as part of a Customer object. The CustomerStandingSelectionModel is an implementation of IPropertySelectionModel that takes a List<CustomerStanding> which is fetched via the CustomerStandingDao. The selection list displays correctly--however, the value corresponding to the customer.standing property is never selected (no value is selected, in fact). The problem is that the customer.standing value never equals() any of the objects from the List<CustomerStanding>, despite the fact that it should be. Most of the reading I've done suggests that problems like this can arise from using objects that are detached from the hibernate session, but both the Customer object and the CustomerStanding list are being loaded by the same session (I've verified this with the debugger.) Does anyone have any idea what's going on here? My understanding is that hibernate should be returning the same object for all references to the same database row (assuming the same session), but that just doesn't seem to be happening. Has anyone else run into this problem? TIA, -Jason (Sorry about the long post, which might be better asked on the Hibernate lists, but it seems like such a common operation under Tapestry that someone here might have run into it...) -- SHIFT TO THE LEFT! SHIFT TO THE RIGHT! POP UP, PUSH DOWN, BYTE, BYTE, BYTE! -------------- Jason Dyer BlueTarp Financial, inc. --------------------------------------------------------------------- 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]
