Hi!
Just a question, has the behaviour of @Persist changed? I was working with
the version tapestry 5.3.0, and tried to change it to the release to test
it, but some things stopped working.
For example, I have this class, that simply contains the data to filter a
search:
public class ProjectFilter implements IFilter {
private Organization organization;
private ProjectState state;
public Organization getOrganization() {
return organization;
}
public void setOrganization(Organization organization) {
this.organization = organization;
}
public ProjectState getState() {
return state;
}
public void setState(ProjectState state) {
this.state = state;
}
}
In my page I have a grid that prints the results of the search, and a
beaneditform with the filter. The submit-button reloads the page, the
cancel-button is supposed to clean the filter.
thats how it was working before I changed to the new release:
@Property
@Persist
private ProjectFilter filter;
void onCanceled() {
this.filter=null;
}
@SetupRender
void onSetupForRender() {
initializeFilter();
}
private void initializeFilter() {
if (filter==null) {
filter = new ProjectFilter();
if (this.orgId!=null) {
filter.setOrganization(organizationService.getOrganizationById(Long.valueOf(this.orgId)));
}
}
}
public List<Project> getProjects()
{
return projectService.findProjectByFilter(filter);
}
The problem is that now, when I push the cancel button, the filter is
nullified, but tapestry at some point of the process refills it again when
the last not null value.
I've fixed it using a zone and not reloading the whole page, I guess that's
the correct way to do it and before I was somehow missunderstanding the
filosofy of tapestry ... but I still wonder why it did worked before and
not anymore, why does it work if I give it a different value, but if I
nullify it tapestry doesn't like it and gives it again a value...?
Thanx!
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/VOTE-Tapestry-5-3-revised-tp5002992p5004161.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]