Newbie Question about populating form values

2010-04-14 Thread David Hamilton
I'm a new Wicket using trying to figure out how to populate a form's initial value with data from a bean (that is in the session already). I've actually got it working, but I don't think I'm doing the best way. public final class EmployeeMain extends BasePage { public EmployeeMain() {

Re: Newbie Question about populating form values

2010-04-14 Thread Nikita Tovstoles
If you're using a CPM there's no need to explicitly set models for child components. Also think about what you want to happen on page reload. Generally I'd imagine you want current data, so set CPM's object on Page.onBeforeRender(): public class EmployeeMain extends BasePage{ final private

Re: Newbie Question about populating form values

2010-04-14 Thread James Carman
Why not use a LoadableDetachableModel instead of setting on onBeforeRender()? On Wed, Apr 14, 2010 at 12:10 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: If you're using a CPM there's no need to explicitly set models  for child components. Also think about what you want to happen on

Re: Newbie Question about populating form values

2010-04-14 Thread Nikita Tovstoles
Yeah, guess you could do that too, but then you'd have to wrap one model into another (since LDM does not do property matching like CPM) + you've to extend LDM. On Wed, Apr 14, 2010 at 9:24 AM, James Carman jcar...@carmanconsulting.comwrote: Why not use a LoadableDetachableModel instead of

Re: Newbie Question about populating form values

2010-04-14 Thread James Carman
That's one of the key concepts of Wicket models. On Wed, Apr 14, 2010 at 2:04 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: Yeah, guess you could do that too, but then you'd have to wrap one model into another (since LDM does not do property matching like CPM) + you've to extend LDM.