Am 21.01.2013 09:55, schrieb Martin Grigorov:
What would such converter actually do? I guess the encoder for an employee
it will generate PageParameters with id->empId (assuming you want a nice
looking url which will encode 'employee' as Url segment, e.g.
/company/employee/34).
Later the decoder will do what ? Will make a request to the DB to load all
the details for the Employee ? I think it should provide a model -
MyPage(IModel<Employee>), e.g. LDM<Employee>, and make the request to the
DB as late as possible. But we already have this constructor in (Web)Page
API (org.apache.wicket.Page#Page(IModel))
I think more of a PageParameter<->Bean converter .. no DB access.
I did this before, but more this way:
public MyPage(PageParameters p) {
MyBean state=MyBean.from(p);
// some code
MyBean newState=state.withId(nextEntryId);
add(new BookmarkableStateLink("link",MyPage.class,newState));
}