Please list your constructors of your custom component. I believe the auto-resolving of models from a parent CPM is done during the constructor (the one with just the component id).
On Sat, May 28, 2011 at 8:27 AM, andrea del bene <andrea.on....@libero.it> wrote: > Hi, > Have you called setType(Calendar.class) in your custom form component? Does > its model remain 'null'? >> >> Hi all, >> >> I am pretty new to Wicket (using 1.4.10) and have some hard time to figure >> out how the interaction between components and models exactly works. So I >> was hopeing that someone here could enlighten me or tell me where I should >> look (WARNING: Rather lengthy post). >> >> My particular problem is that I have a custom component that extends >> FormComponent<Calendar> to display a date in a certain way. This component >> is part of a Panel in which I use a CompoundPropertyModel to render an >> object containing a calendar among other things (the object is fully >> populated and load from the database by using a LoadableDetachableModel >> chained to the CompoundPropertyModel). >> >> For the other object fields I simply use TextFields which get populated >> properly and when I use a TextField<calendar> instead of my custom component >> the field contains the result of Calendar.toString so I guess the Panel it's >> children and the corresponding are set up correctly. >> >> But whenever I use my custom component I don't get a reference to that >> Calendar instance. I did try to get some insights by looking into the code >> of the TextField class and overriding various methods from super classes but >> I just did not get it. >> >> To my understanding something like setModel or setModelObject on my >> component should be called so I can override this method and do my custom >> stuff in it. But somehow this does not happen. During debugging I saw that >> the Panel is set as my components parent and everything seeme to be stuck >> together correctly. But somehow I can't get the Calendar instance from my >> object to get set as my components model value. >> >> So I figure that I am missing some vital point on this topic and would be >> very grateful for any advice, like an how to for extending Components or >> something similar. >> >> Thanks for reading this far, >> Chris >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org