Re: Default implementation of IChainingModel

2009-10-01 Thread Daniel Stoch
;s one. import org.apache.wicket.model.IChainingModel; import org.apache.wicket.model.IDetachable; import org.apache.wicket.model.IModel; /** * Basic implementation of {...@link IChainingModel} interface. * * @author Daniel Stoch * */ public class ChainingModel implements IChainingModel { /**

Re: Default implementation of IChainingModel

2009-09-30 Thread Scott Swank
create > one, can you post yours and post a link to it back on this thread? > > Thanks! > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Wed, Sep 30, 2009 at 4:45 PM, Scott Swank wrote: > >> I searched the JIRA for IChainingModel and

Re: Default implementation of IChainingModel

2009-09-30 Thread Jeremy Thomerson
JIRA for IChainingModel and didn't get any hits. Did > anyone create a JIRA issue? Here's an implementation of mine. > > public class BaseChainingModel implements IChainingModel { >private static final long serialVersionUID = 1L; >private Object target; > >

Re: Default implementation of IChainingModel

2009-09-30 Thread Scott Swank
I searched the JIRA for IChainingModel and didn't get any hits. Did anyone create a JIRA issue? Here's an implementation of mine. public class BaseChainingModel implements IChainingModel { private static final long serialVersionUID = 1L; private Object target;

Re: Default implementation of IChainingModel

2009-04-08 Thread Jeremy Thomerson
,First of all, I'm using wicket 1.3.5 > > I'm writing a model and ai need it to be "chaineable". I mean, I need this > model to contain another model, so my model can obtain the data, for > example, from a property model. > Ok, I've been reading and this is solv

Default implementation of IChainingModel

2009-04-08 Thread Juan G. Arias
Hi all,First of all, I'm using wicket 1.3.5 I'm writing a model and ai need it to be "chaineable". I mean, I need this model to contain another model, so my model can obtain the data, for example, from a property model. Ok, I've been reading and this is solved by t

Re: IChainingModel

2008-12-05 Thread jWeekend
gt; expression with "object" to get the value out? > > -igor > > On Thu, Dec 4, 2008 at 7:31 AM, jWeekend <[EMAIL PROTECTED]> > wrote: >> >> John, >> >> Well spotted. AbstractPropertyModel implements IChainingModel but breaks >> its >&g

Re: IChainingModel

2008-12-05 Thread jWeekend
... In my rush to get out I hit post instead of preview. Now I've come back and reviewed it here's a completed and *corrected* version, hopefully a bit clearer and precise. Excuse any confusion caused. Jeremy, AbstractPropertyModel _should_ implement IChainingModel; this tells us

Re: IChainingModel

2008-12-05 Thread jWeekend
Jeremy, People will find your blog entry useful, but this issue is a bit more specific. AbstractPropertyModel _should_ implement IChainingModel, that's how you know it _should_ dig values out model objects which r themselves models. Now try this: public class TestPropertyModelsChainin

Re: IChainingModel

2008-12-04 Thread Jeremy Thomerson
(tmp == object) break; object = tmp; } return object; } John - I think you're right - it is unnecessary to implement IChainingModel since there is no code in the wicket core codebase that calls it's methods. Just make sure that if you nest models inside of ot

Re: IChainingModel

2008-12-04 Thread Igor Vaynberg
when you give propertymodel anoter imodel do you have to begin the expression with "object" to get the value out? -igor On Thu, Dec 4, 2008 at 7:31 AM, jWeekend <[EMAIL PROTECTED]> wrote: > > John, > > Well spotted. AbstractPropertyModel implements IChainingMod

Re: IChainingModel

2008-12-04 Thread jWeekend
John, Well spotted. AbstractPropertyModel implements IChainingModel but breaks its contract : * Models that implement this interface will support chaining of IModels. getObject() of a * IChainingModel should do something like: * * * if ( object instanceof IModel) { return ((IModel)object

IChainingModel

2008-12-04 Thread John Patterson
Hi, I'm messing about with nested models and see the IChainingModel interface which is implemented by the PropertyModels but its methods never actually seems to be used. So I'm just checking that I haven't missed anything... for nested models I don't actually need to impleme

Re: Component.wrap and IChainingModel

2007-11-12 Thread Dmitry Kandalov
On Monday 12 November 2007 22:13:33 ChuckDeal wrote: > > You're right. But if you were not using List you could return SortedSet > > from > > SortingModel and it would work :) > > But then I'd be using a Set instead of a List.  DropDownChoice (via > AbstractChoice) expects the choices model to repr

Re: Component.wrap and IChainingModel

2007-11-12 Thread ChuckDeal
eded and then the sort would take place. > > You're right. But if you were not using List you could return SortedSet > from > SortingModel and it would work :) > But then I'd be using a Set instead of a List. DropDownChoice (via AbstractChoice) expects the choices model to repre

Re: Component.wrap and IChainingModel

2007-11-09 Thread Dmitry Kandalov
On Thursday 08 November 2007 23:28:40 ChuckDeal wrote: > > Perhaps I didn't get the explanation but why can't you wrap models in > > this order? > > > > AppendingListModel( > >     SortingModel( > >         HibernateListModel() > >     ) > > ) > > In that order the list would be sorting PRIOR to ap

Re: Component.wrap and IChainingModel

2007-11-08 Thread ChuckDeal
Johan Compagner wrote: > >> >> >> SortingModel (IChainingModel) -> AppendingListModel >> (IComponentAssignmentModel) -> HibernateListModel (database oriented >> model >> that returns a list of items from the db, unsorted). > > > > So

Re: Component.wrap and IChainingModel

2007-11-08 Thread ChuckDeal
Dmitry Kandalov wrote: > > On Wednesday 07 November 2007 01:18:32 ChuckDeal wrote: > >> SortingModel (IChainingModel) -> AppendingListModel >> (IComponentAssignmentModel) -> HibernateListModel (database oriented >> model >> that returns a list of items

Re: Component.wrap and IChainingModel

2007-11-08 Thread Dmitry Kandalov
On Wednesday 07 November 2007 01:18:32 ChuckDeal wrote: > SortingModel (IChainingModel) -> AppendingListModel > (IComponentAssignmentModel) -> HibernateListModel (database oriented model > that returns a list of items from the db, unsorted). Perhaps I didn't get the explanati

Re: Component.wrap and IChainingModel

2007-11-06 Thread Johan Compagner
> > > SortingModel (IChainingModel) -> AppendingListModel > (IComponentAssignmentModel) -> HibernateListModel (database oriented model > that returns a list of items from the db, unsorted). So the sorting model is the outside one that you give to the component But if we

Re: Component.wrap and IChainingModel

2007-11-06 Thread ChuckDeal
is doing X? > yes, that's it, roughly. Johan Compagner wrote: > > But what do you give to the component then? And why must is wrap? > > johan > I don't know if you'll be able to see it from this description, but here is a specific scenario. SortingModel (IC

Re: Component.wrap and IChainingModel

2007-11-06 Thread Johan Compagner
. Previously, I had extended the > HibernateListModel > > to > > make a SortableHibernateListModel, which worked very well. However, > That > > style of adding features gets cumbersome as you try to add new features > > in. > > For instance, next was a FilterableHi

Re: Component.wrap and IChainingModel

2007-11-06 Thread ChuckDeal
ed to > sort). > > So, I tried another approach whereby I would chain the operations > together. > So, I created a SortingModel that implements the IChainingModel interface > and then stuck the HibernateListModel inside of it. And that still > worked. > But, in another

Re: Component.wrap and IChainingModel

2007-11-06 Thread Johan Compagner
ch whereby I would chain the operations > together. > So, I created a SortingModel that implements the IChainingModel interface > and then stuck the HibernateListModel inside of it. And that still > worked. > But, in another place, the model that I put into the SortingModel > (IChaini

Component.wrap and IChainingModel

2007-11-06 Thread ChuckDeal
sort). So, I tried another approach whereby I would chain the operations together. So, I created a SortingModel that implements the IChainingModel interface and then stuck the HibernateListModel inside of it. And that still worked. But, in another place, the model that I put into the