|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
PropertyModel implementing IComponentInheritedModelHi,
if I haven't overlooked something, there's no variant of PropertyModel implementing IComponentInheritedModel. IComponentInheritedModel demands only one method, wrapOnInheritance. Looking at the implementation of CompoundPropertyModel, wrapOnInheritance does nothing but return an AttachedCompoundPropertyModel, which in turn seems not specific to CompoundPropertyModel. Shouldn't the same approach work in PropertyModel? Is there a downside to making a model an IComponentInheritedModel? Cheers, Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: PropertyModel implementing IComponentInheritedModelWhy should the propertymodel be an inherited?
Propertymodel is assignable model. Compound is inherited. Property model isnt meant to be shared over multiple components thats why we have compound On 7/5/08, Thomas Kappler <tkappler@...> wrote: > Hi, > > if I haven't overlooked something, there's no variant of PropertyModel > implementing IComponentInheritedModel. > > IComponentInheritedModel demands only one method, wrapOnInheritance. > Looking at the implementation of CompoundPropertyModel, > wrapOnInheritance does nothing but return an > AttachedCompoundPropertyModel, which in turn seems not specific to > CompoundPropertyModel. > > Shouldn't the same approach work in PropertyModel? Is there a downside > to making a model an IComponentInheritedModel? > > Cheers, > Thomas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: PropertyModel implementing IComponentInheritedModelThanks, Johan. Perhaps I wasn't clear enough about the motivation.
On Sun, Jul 6, 2008 at 6:51 AM, Johan Compagner <jcompagner@...> wrote: > Why should the propertymodel be an inherited? Well, to have model sharing. So why not just use a CPM? Because it has another difference to PM: you don't give the property expression explicitly, but the component name is used. When you don't want that (keep your HTML independent of your Java), or can't do that (reusable panels), you can't use CPM. So, what I'd like is a CompoundPropertyModel(Object, String) that works like in PM: "Construct with a wrapped (IModel) or unwrapped (non-IModel) object and a property expression that works on the given model.". I feel like I'm missing something basic here, sorry - perhaps you can enlighten me why this wouldn't make sense. Cheers, Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: PropertyModel implementing IComponentInheritedModelHave you seen BoundCompoundPropertyModel?
It sounds like you are looking for that behavior. Maurice On Sun, Jul 6, 2008 at 9:42 AM, Thomas Kappler <tkappler@...> wrote: > Thanks, Johan. Perhaps I wasn't clear enough about the motivation. > > On Sun, Jul 6, 2008 at 6:51 AM, Johan Compagner <jcompagner@...> wrote: >> Why should the propertymodel be an inherited? > > Well, to have model sharing. So why not just use a CPM? Because it has > another difference to PM: you don't give the property expression > explicitly, but the component name is used. When you don't want that > (keep your HTML independent of your Java), or can't do that (reusable > panels), you can't use CPM. > > So, what I'd like is a CompoundPropertyModel(Object, String) that > works like in PM: "Construct with a wrapped (IModel) or unwrapped > (non-IModel) object and a property expression that works on the given > model.". > > I feel like I'm missing something basic here, sorry - perhaps you can > enlighten me why this wouldn't make sense. > > Cheers, > Thomas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: PropertyModel implementing IComponentInheritedModelBounded is deprecated look at CompoundPropertyModel.bind(String)
so CompoundPropertyModel cpm = new CompoundPropertyModel(); Form form = new Form("form", cpm) form.add(new TextField("name", cpm.bind("firstName")); johan On Mon, Jul 7, 2008 at 8:59 AM, Maurice Marrink <marrink@...> wrote: > Have you seen BoundCompoundPropertyModel? > > It sounds like you are looking for that behavior. > > Maurice > > On Sun, Jul 6, 2008 at 9:42 AM, Thomas Kappler <tkappler@...> > wrote: > > Thanks, Johan. Perhaps I wasn't clear enough about the motivation. > > > > On Sun, Jul 6, 2008 at 6:51 AM, Johan Compagner <jcompagner@...> > wrote: > >> Why should the propertymodel be an inherited? > > > > Well, to have model sharing. So why not just use a CPM? Because it has > > another difference to PM: you don't give the property expression > > explicitly, but the component name is used. When you don't want that > > (keep your HTML independent of your Java), or can't do that (reusable > > panels), you can't use CPM. > > > > So, what I'd like is a CompoundPropertyModel(Object, String) that > > works like in PM: "Construct with a wrapped (IModel) or unwrapped > > (non-IModel) object and a property expression that works on the given > > model.". > > > > I feel like I'm missing something basic here, sorry - perhaps you can > > enlighten me why this wouldn't make sense. > > > > Cheers, > > Thomas > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@... > > For additional commands, e-mail: users-help@... > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > |
|
|
Re: PropertyModel implementing IComponentInheritedModelOn Mon, Jul 7, 2008 at 10:17 AM, Johan Compagner <jcompagner@...> wrote:
> CompoundPropertyModel cpm = new CompoundPropertyModel(); > Form form = new Form("form", cpm) > form.add(new TextField("name", cpm.bind("firstName")); Perfect! Had overlooked that. Thanks, Thomas > On Mon, Jul 7, 2008 at 8:59 AM, Maurice Marrink <marrink@...> wrote: > >> Have you seen BoundCompoundPropertyModel? >> >> It sounds like you are looking for that behavior. >> >> Maurice >> >> On Sun, Jul 6, 2008 at 9:42 AM, Thomas Kappler <tkappler@...> >> wrote: >> > Thanks, Johan. Perhaps I wasn't clear enough about the motivation. >> > >> > On Sun, Jul 6, 2008 at 6:51 AM, Johan Compagner <jcompagner@...> >> wrote: >> >> Why should the propertymodel be an inherited? >> > >> > Well, to have model sharing. So why not just use a CPM? Because it has >> > another difference to PM: you don't give the property expression >> > explicitly, but the component name is used. When you don't want that >> > (keep your HTML independent of your Java), or can't do that (reusable >> > panels), you can't use CPM. >> > >> > So, what I'd like is a CompoundPropertyModel(Object, String) that >> > works like in PM: "Construct with a wrapped (IModel) or unwrapped >> > (non-IModel) object and a property expression that works on the given >> > model.". >> > >> > I feel like I'm missing something basic here, sorry - perhaps you can >> > enlighten me why this wouldn't make sense. >> > >> > Cheers, >> > Thomas >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: users-unsubscribe@... >> > For additional commands, e-mail: users-help@... >> > >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
| Free Forum Powered by Nabble | Forum Help |