I didn't actually try that...but I like the idea of setting the page model and having access to it that way...that seems to work just fine. Thanks!On 4/2/06,
karthik Guru [EMAIL PROTECTED] wrote:
just curiousBlog blog = (Blog)blogModel.getObject(null);didn't work for you?On 4/3/06, Vincent Jenks
I'm just testing something out. Since I use EJB3 and need lazy initialization I'm making an attempt to see if passing an object with a collection of lazily-loaded elements in an IModel, from page-to-page, will prevent a LazyInitializationException (Hibernate).
I start here in the first page:public
The model isn't of type Blog. The object stored within
LoadableDetachableModel is of type Blog.
Blog blog = (Blog)blogModel.getObject( )
should hopefully work.?
On 4/2/06, Vincent Jenks [EMAIL PROTECTED] wrote:
I'm just testing something out. Since I use EJB3 and need lazy
initialization I'm
That won't work, since getObject takes a parameter of Componentwhat would I pass in?On 4/2/06, karthik Guru
[EMAIL PROTECTED] wrote:The model isn't of type Blog. The object stored within
LoadableDetachableModel is of type Blog.Blog blog = (Blog)blogModel.getObject( )should hopefully work.?On
Aaargh. Ok, final try:
public HeaderPanel(String id, IModel blogModel) {
super(id, blogModel);
Blog blog = (Blog)getModelObject();
or
public HeaderPanel(String id, IModel blogModel) {
super(id);
setModel(blogModel);
Blog blog = (Blog)getModelObject();
Eelco
On 4/2/06, Eelco
Oh, I didn't look at your example yet. Better is this:
public HeaderPanel(String id, IModel blogModel)
{
super(id);
Blog blog = (Blog)getModelObject();
Eelco
On 4/2/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
Just pass in null. The component parameter is only used by
Just pass in null. The component parameter is only used by
CompoundPropertyModel and friends, not by LoadableDetachableModel.
Eelco
On 4/2/06, Vincent Jenks [EMAIL PROTECTED] wrote:
That won't work, since getObject takes a parameter of Componentwhat
would I pass in?
On 4/2/06, karthik
I'm not really up to date with wicket but in old versions you would have
done, I suppose it hasn't changed anyway.
blogModel.getModelObject().
Vincent Jenks wrote:
That won't work, since getObject takes a parameter of
Componentwhat would I pass in?
On 4/2/06, *karthik Guru* [EMAIL
just curious
Blog blog = (Blog)blogModel.getObject(null);
didn't work for you?
On 4/3/06, Vincent Jenks [EMAIL PROTECTED] wrote:
Works great, thanks Eelco!
On 4/2/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
Aaargh. Ok, final try:
public HeaderPanel(String id, IModel blogModel) {