Here's the deal. 1) I always recommend that you provide an explicit t:id for form fields, rather than let Tapestry assign the id. In fact, I recommend assigning an t:id to all non-trivial components. 2) Often, but far from always, you would end up using the same string in a TextField for t:id and for the name of the property being edited (the t:value parameter). 3) Thus the carrot: you can omit t:value when it will match t:id; the TextField and similar components can default t:value based on t:id. 4) Don't fit that mold? Use an explicit t:value.
So this is bad from one philosophy: that there should only be one way to accomplish any one goal. But I think it is good in terms of making things Just Work, which I find to be very pragmatic. On 9/7/07, smithfox <[EMAIL PROTECTED]> wrote: > > > I do more test based you simple. > Yes, a nested class also work. > > As you said: It's not tapestry issue. > > Your code is: > [Page.java] > private BznsPojo pojo= new BznsPojo(); > > My code is: > [Page.java] > private BznsPojo pojo; > > @BeginRender > void beginRender(){ > pojo = createNewPojo(); > } > > private BznsPojo createNewPojo(){ > BznsPojo pojo = new BznsPojo(); > Product product = new Product(); > pojo.setProduct(product); > return pojo; > } > > > So the problem is caused by lifecycle of pojo: > I guess that pojo's nested field object have already referenced by page > template before BeginRender( and SteupRender) event. > > So I change the code: > > My code is: > [Page.java] > @Retain > private BznsPojo pojo; > > ..... > > > OK, It work. > > Thank for Filip's help. > > > > > Filip S. Adamsen-2 wrote: > > > > I did a test, and it worked. > > > > Can you show me more of your source code? It might be some non-Tapestry > > issue. > > > > smithfox skrev: > >> Thank your very much. > >> I test your code. It can pass. > >> > >> But my case is different with yours. > >> Your business object is a simple POJO class. > >> But if you add another business class to the simple POJO class as a > >> field, > >> the tapestry doesn't recognise it. > >> > >> "sale.date" can pass, > >> But "sale.product.price" can't pass. > >> > >> You can do a test. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/T5%3A-How-to-bind-composite-class%27-field%28like-sale.product.price%29-in-page-template-tf4395512.html#a12555589 > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind