and what should that paremeterless override pass in to the getObject(Component c)? null? that will work, but will break down if you have a compound model - and more often then not you do.

so i dont know if this is such a good thing

-Igor


On 6/1/06, Aaron Hiniker <[EMAIL PROTECTED]> wrote:
+1


On Wed, 2006-05-31 at 20:47 -0600, VGJ wrote:
I might just be nit-picking here...but it might be nice to have a parameter-less override of getObject....just for prettiness ;)  It might be more intuitive for the first-time user as well?  It would be more apparent, IMO, if you could just call model.getObject()

Just a thought...

On Wed, 2006-05-31 at 22:35 +0200, Matej Knopp wrote:
:) Yeah, getObject is a little confusing at the beginning. The parameter 
is mostly used in compound models (CompoundPropertyModel) where the 
model is shared between multiple components to determine which component 
is setting/getting the value.

-Matej

Vincent Jenks wrote:
> Excellent, that's perfect.  The part I was unsure about was what to
> pass for the arguement for getObject()....
> 
> Thanks Matej!
> 
> On 5/31/06, Matej Knopp <[EMAIL PROTECTED]> wrote:
>> Suppose you have
>> IModel model = new LoadableDetachableModel() { ...
>>
>> you can get the model any time:
>> List<Item> myItems = (List<Item>) model.getObject(null).
>>
>> First time you call getObject the model is attached (list is loaded).
>> Until it's detached, getObject(null) will always return the loaded list.
>>
>> -Matej
>>
>> Vincent Jenks wrote:
>> > If I were just displaying the lists in a ListView that'd be fine,
>> > however I'm not using it that way.
>> >
>> > Suppose myDetachedModel is being displayed in a ListView and on each
>> > iteration, I'm grabbing a value from the database (here's where I need
>> > another detachable model) and doing calculations against it - for each
>> > iteration in the ListView loop.
>> >
>> > In other words, I just need access to the raw object data in it's real
>> > data-type after I've loaded it into a detachable model - my question
>> > is simply that, how do I get it back to its original type.
>> >
>> > On 5/31/06, Matej Knopp <[EMAIL PROTECTED]> wrote:
>> >> I'm not sure I understand you but you load the collections separately?
>> >> Can't you just do something like this?
>> >>
>> >> class MyPage extends Page {
>> >>    public MyPage() {
>> >>      IModel m1 = new LoadableDetachableModel() {
>> >>        Object load() {
>> >>           return [load collection 1];
>> >>        }
>> >>      }
>> >>      add(new ListView("l1", m1) {
>> >>        ...
>> >>      });
>> >>
>> >>      IModel m2 = new LoadableDetachableModel() {
>> >>        Object load() {
>> >>           return [load collection 2];
>> >>        }
>> >>      }
>> >>      add(new ListView("l2", m2) {
>> >>        ...
>> >>      });
>> >>
>> >>    }
>> >> }
>> >>
>> >> Matej
>> >>
>> >> Vincent Jenks wrote:
>> >> > I've got a page where I need to call data from the EntityManger 
>> (EJB3)
>> >> > several times in a single page....which means I'd need to have 
>> several
>> >> > detached-models in the page.
>> >> >
>> >> > Once I put these objects and/or collections of objects into a
>> >> > detachable model, what's the best way to cast them back out to their
>> >> > original types?
>> >> >
>> >> > It seems like a silly question but I'm having trouble w/ it.  If I
>> >> > only had one detached model I realize I could use setModel(...) and
>> >> > grab it w/ getModelObject() - but I've got 3-4 collections and they
>> >> > can't all be the page model, can they?
>> >> >
>> >> > Thanks!
>> >> >
>> >> >
>> >> > -------------------------------------------------------
>> >> > All the advantages of Linux Managed Hosting--Without the Cost and 
>> Risk!
>> >> > Fully trained technicians. The highest number of Red Hat
>> >> certifications in
>> >> > the hosting industry. Fanatical Support. Click to learn more
>> >> >
>> >> 
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

>> >> > _______________________________________________
>> >> > Wicket-user mailing list
>> >> > Wicket-user@lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/wicket-user

>> >> >
>> >>
>> >>
>> >>
>> >> -------------------------------------------------------
>> >> All the advantages of Linux Managed Hosting--Without the Cost and 
>> Risk!
>> >> Fully trained technicians. The highest number of Red Hat
>> >> certifications in
>> >> the hosting industry. Fanatical Support. Click to learn more
>> >> 
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

>> >> _______________________________________________
>> >> Wicket-user mailing list
>> >> Wicket-user@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/wicket-user

>> >>
>> >
>> >
>> > -------------------------------------------------------
>> > All the advantages of Linux Managed Hosting--Without the Cost and Risk!
>> > Fully trained technicians. The highest number of Red Hat 
>> certifications in
>> > the hosting industry. Fanatical Support. Click to learn more
>> > 
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

>> > _______________________________________________
>> > Wicket-user mailing list
>> > Wicket-user@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/wicket-user

>> >
>>
>>
>>
>> -------------------------------------------------------
>> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
>> Fully trained technicians. The highest number of Red Hat 
>> certifications in
>> the hosting industry. Fanatical Support. Click to learn more
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user

>>
> 
> 
> -------------------------------------------------------
> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> Fully trained technicians. The highest number of Red Hat certifications in
> the hosting industry. Fanatical Support. Click to learn more
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user

> 



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Reply via email to