Re: T5 Selected Attribute

2011-07-06 Thread Lenny Primak
I don't even use @Property annotation, is's just @Getter / @Setter from Lombok, also SneakyThrows is great. Cuts down on code tremendously. On Jul 6, 2011, at 1:33 PM, George Christman wrote: > Thanks Thiago, I finally have this some what working :) Add some logic so > it's not resetting every

Re: T5 Selected Attribute

2011-07-06 Thread George Christman
Thanks Thiago, I finally have this some what working :) Add some logic so it's not resetting every menu on the page and we should be good to go lol. Any thoughts on using Lombok's annotations for the entity classes? First I've heard of it. -- View this message in context: http://tapestry.104571

Re: T5 Selected Attribute

2011-07-06 Thread Thiago H. de Paula Figueiredo
On Wed, 06 Jul 2011 14:06:26 -0300, George Christman wrote: So would I be generating the hashCode equals within the funding class? Yes. The class whose instances are used as options in the Select component. Also, that select menu is being used within an AjaxFormLoop with a value encoder

Re: T5 Selected Attribute

2011-07-06 Thread Lenny Primak
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 wrote:

Re: T5 Selected Attribute

2011-07-06 Thread George Christman
So would I be generating the hashCode equals within the funding class? Also, that select menu is being used within an AjaxFormLoop with a value encoder which is using the Transient temp id. How would hashCode work when the ID is null? Thanks Thiago -- View this message in context: http://tapestr

Re: T5 Selected Attribute

2011-07-06 Thread Thiago H. de Paula Figueiredo
If you use Eclipse, Source -> Generate hashCode() and equals() generates good implementations of these methods. You'll need to choose the fields used: check just the id one. On Wed, 06 Jul 2011 12:23:34 -0300, George Christman wrote: Here's my Funding class @Entity public class Funding

Re: T5 Selected Attribute

2011-07-06 Thread George Christman
Here's my Funding class @Entity public class Funding extends BaseEntity implements Labeled { //BaseEntity is just the generated ID. private String name; private String label; @OneToMany(mappedBy = "funding", cascade=CascadeType.ALL) private List lineItemFundings; @ManyToO

Re: T5 Selected Attribute

2011-07-06 Thread Thiago H. de Paula Figueiredo
On Wed, 06 Jul 2011 11:35:23 -0300, George Christman wrote: Is there any chance you guys could help me write out the hashCode equals with the select menu. Yes, but you haven't sent us what we need to help you: the Funding class source. -- Thiago H. de Paula Figueiredo Independent Java,

Re: T5 Selected Attribute

2011-07-06 Thread George Christman
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 c

Re: T5 Selected Attribute

2011-07-05 Thread Thiago H. de Paula Figueiredo
On Tue, 05 Jul 2011 16:04:59 -0300, George Christman wrote: Object entity label using UUID transient temp Ids. I'm also using an encoder with the select menu. Not sure if that matters. They don't. Funding class sources, specially hashCode() and equals(), do matter. ;) -- Thiago H. de P

Re: T5 Selected Attribute

2011-07-05 Thread George Christman
Object entity label using UUID transient temp Ids. I'm also using an encoder with the select menu. Not sure if that matters. fundingModel = selectModelFactory.create(purchaseRequest.getFundings(), "label"); Thanks for the article, reading as we speak. -- View this message in context: http://t

Re: T5 Selected Attribute

2011-07-05 Thread Taha Hafeez
http://www.jchq.net/certkey/0902certkey.htm What is the type of value bound to select ? regards Taha On Wed, Jul 6, 2011 at 12:17 AM, George Christman wrote: > Thanks everyone, I'm pretty new to backend development, so I guess I don't > completely understand hashcode equals and how it works.

Re: T5 Selected Attribute

2011-07-05 Thread George Christman
Thanks everyone, I'm pretty new to backend development, so I guess I don't completely understand hashcode equals and how it works. -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Selected-Attribute-tp4554181p4554302.html Sent from the Tapestry - User mailing list archiv

Re: T5 Selected Attribute

2011-07-05 Thread Taha Hafeez
Hi Firstly if you set a default value in onPrepare(), it will not only set the value during render but also during submission, which I don't think you intend to. A better choice will be onPrepareForRender(). Secondly, all you have to do is set the value that is bound to the select component to a

Re: T5 Selected Attribute

2011-07-05 Thread George Christman
Hi Taha, this is my test code. Long key = new Long("-8879035676972742623"); for(LineItem _lineItem : getPurchaseRequest().getLineItems()) { for (LineItemFunding _lineItemFunding : _lineItem.getLineItemFundings()) { if(_lineItemFunding.getTemp

Re: T5 Selected Attribute

2011-07-05 Thread Thiago H. de Paula Figueiredo
On Tue, 05 Jul 2011 15:02:22 -0300, George Christman wrote: Hello, Hi! In my onPrepare method, I'm trying to select a select menu option by default. I'm aware of tapestry being able to handle this automatically by setting the object value, however I haven't had any success. If someone c

Re: T5 Selected Attribute

2011-07-05 Thread Taha Hafeez
Hi Can you share the code ? regards Taha On Tue, Jul 5, 2011 at 11:32 PM, George Christman wrote: > Hello, In my onPrepare method, I'm trying to select a select menu option by > default. I'm aware of tapestry being able to handle this automatically by > setting the object value, however I have