I suggest you take a look at project Lombok. 
It has annotation @Data that automatically generates all getters, setters, 
toStong
and hashCode automatically and at runtime for you. Perfect for entity classes 
and makes code very very small. 



On Jul 6, 2011, at 10:35 AM, George Christman <gchrist...@cardaddy.com> wrote:

> Is there any chance you guys could help me write out the hashCode equals with
> the select menu. I'm having a difficult time comprehending this for some
> reason. I'm hoping after seeing an example, I'll be able to finally bring it
> all together. 
> 
> To keep things simple, the tml contains a nested loop containing a select
> menu. 
> 
> .tml
> <t:Loop source="purchaseRequest.lineItems" value="lineItem">
>     <t:Loop source="lineItem.lineItemFundings" value="lineItemFunding">
>               <t:Select value="lineItemFunding.funding"
> model="fundingModel"/>t
>    </t:Loop>
> </t:Loop>
> 
> java code
> 
> @Property
> private PurchaseRequest purchaseRequest;
> 
> @Property
> private LineItem lineItem;
> 
> @Property
> private LineItemFunding lineItemFunding;
> 
> @Property
> @Persist
> private SelectModel fundingModel;
> 
> void onPrepareForRender() {
>     fundingModel = selectModelFactory.create(purchaseRequest.getFundings(),
> "label");
> 
>    //for testing, i'm manually setting the value to get it to reload the
> menu with selected attribute.
> 
>    for(LineItem _lineItem : purchaseRequest.getLineItems()) {
>         for (LineItemFunding _lineItemFunding :
> _lineItem.getLineItemFundings()) {
>             //This is where I'm attempting to set the _lineItemFunding menu
> with funding object.
>              _lineItemFunding.setFunding((Funding)
> session.get(Funding.class, 1));
>         }
>    }
> }
> 
> When the form is submitted, I'm only persisting the data to the user session
> and not committing to database. I'm only doing this to reload all the select
> menus without losing any other form data. I'm just not sure how to write the
> hashCode to work with this.
> 
> Thanks everyone, you've been a tremendous help. 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/T5-Selected-Attribute-tp4554181p4556947.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to