• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Tapestry 5 presist properties

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am starting a new small project so I thought it would be a good idea to test a new framework so I decided to change to tapestry 5.

I read that the properties used on the page are cleared on each request. It seems that it is partially truth. If I use String or native properties this happens, I change the value on a form, receive the value correctly and when the page is displayed again it is cleared. If I use the Persist annotation I can keep the value.

The problem is when I use Object properties. For example, if I have on a Page:

private Address address=new Address;

public Address getAddress(){ return address;}
public void setAddress(Address add){this.address=add;}

And on the template page:
...
<input t:type="textfield" t:id="street" t:value="address.street"/>

if I submit the form and display the same page again, the property Address just keeps the street info. And even worst, if I open the same page on another machine, the application displays the values introduced by the first user :|.

I know that pages are pooled, so this may be the problem. In this particular case I am not using the beanformeditor because the Address object has a State Object as a property so the BeanFormEditor dose not display well the form.

Is there a way (maybe an annotation) to tell tapestry to treat this bean as the other properties ?.

Thank you (By the way, I hope I could explain my problem, my English is not good enough)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic