Re: RefreshingView
ah noo i am wrong, the type parameter is for the items that are used inside, not for the model of the refreshingview itself. my fault, sry. :D though but your answer didnt help me to find that out... ;) MartinM wrote: > > It has getDefaultModelObject etc?? > > ** > Martin > > 2009/9/27 : >> heyho, >> >> public abstract class RefreshingView extends RepeatingView has the >> typeparameter but no public IModel getModel(). can someone add it >> please or let me add it, i would do it too, plus setModel(), >> setModelObject(), getModelObject(). >> >> regarz >> -- >> Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate >> für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02 >> >> - >> 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 > > > -- View this message in context: http://www.nabble.com/RefreshingView-tp25636765p25637138.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RefreshingView
heyho, public abstract class RefreshingView extends RepeatingView has the typeparameter but no public IModel getModel(). can someone add it please or let me add it, i would do it too, plus setModel(), setModelObject(), getModelObject(). regarz -- Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 2 new models for wicket
;> object-hosting model and some kind of property-model that can use the >>> hosting model. the root-markupcontainer would therefor have such a >>> hosting >>> model which provided B. this markup-container would hold A's edit-form >>> as a >>> child and give it such a property-model that can access the host-model's >>> object. now the magic thing, this property-model in turn would serve as >>> host >>> for A's edit-form. all the components in this edit-form in turn would >>> have >>> such property-models again, that access the edit-forms modelobject and >>> resolve the desired properties. >>> >>> therefor i called this property-model InheritedPropertyModel. another, >>> in >>> my eyes, advantage is, that if a component doesnt have its own model, it >>> will receive the next model up in the component-hierarchy. and because i >>> think this is good, i also made the host-model an inheritedmodel and >>> since >>> it is also chainable, i called it InheritedChainableModel. >>> >>> now i tried to implement those two and there is a problem i'm facing. i >>> can't traverse through the component-hierarchy to find the right >>> model-object. i need this object so i can run the propertyresolver on >>> it. i >>> can only call getDefaultModelObject() to find out. and now there is the >>> problem: >>> >>> imagine the following component hierarchy: >>> panel->markupcontainer->form->label >>> >>> InheritedChainingModel->InheritedPropertyModel->nothing->InheritedPropertyModel >>> B->A->nothing->somePropertyOfA >>> >>> the label calls getObject(): >>> this.owner.getParent().getDefaultModelObject() >>> the InheritedPropertyModel knows its owner (IComponentAssignedModel) >>> which >>> is the label, calls its parent, which is the form and asks for the >>> default >>> model-object. since the form doesnt have a model, it's >>> getDefaultModelObject() calls: initModel() >>> initModel() traverses the component-hierarchy up until it finds the >>> first >>> IComponentInheritedModel. it finds it in the markupcontainer and its an >>> InheritedPropertyModel. this one now is asked getObject(): >>> this.owner.getParent().getDefaultModelObject() >>> this one will give the object of the hosting InheritedChainingModel of >>> the >>> panel with B in it. now B is given back to the markupcontainer which >>> continues its getObject(): >>> (W)PropertyResolver.getValue(this.property, target); >>> property is "A" and target is B -> A as object is returned to the form >>> which in turn continues its getObject(): >>> (W)PropertyResolver.getValue(this.property, target); >>> since this model is an inherited from markupcontainer, it has the same >>> property which is "A", but the target this time is A itself, coming from >>> the >>> markupcontainer. >>> >>> and this is the problem... when i look at a components model, i dont >>> want >>> it to be initialized, i just want to know if there is some >>> IComponentInheritedModel. getModelImpl() is the way to go, but it is not >>> visible. getInnermostModel() calls getDefaultModel(). i dont have a >>> chance. >>> or can somebody see a solution to this? i think there isnt any. >>> >>> since i'm willing to contribute those two models, i propose to change >>> something in the wickets component-code. give me a hasModel(). or give >>> me a >>> public getModel(). i would do these changes. >>> >>> tell me your opinion. >>> >>> regards >>> garz >>> >>> ps: here are the sources of the two models: >>> >>> public class InheritedPropertyModel >>> implements IComponentInheritedModel, >>> IComponentAssignedModel >>> { >>> >>> private String property; >>> >>> public InheritedPropertyModel(String property) { >>> if (Strings.isEmpty(property)) >>> throw new IllegalArgumentException("Parameter >>> property cannot be null or empty"); >>> this.property = property; >>> } >>> >>> �...@suppresswarnings("unchecked") >>> �...@override >>> public IWrapModel wrapOnInheritance(Co
2 new models for wicket
thing in the wickets component-code. give me a hasModel(). or give me a public getModel(). i would do these changes. tell me your opinion. regards garz ps: here are the sources of the two models: public class InheritedPropertyModel implements IComponentInheritedModel, IComponentAssignedModel { private String property; public InheritedPropertyModel(String property) { if (Strings.isEmpty(property)) throw new IllegalArgumentException("Parameter property cannot be null or empty"); this.property = property; } @SuppressWarnings("unchecked") @Override public IWrapModel wrapOnInheritance(Component component) { return (IWrapModel) new AttachedInheritedPropertyModel(); } @Override public final T getObject() { throw new RuntimeException("get object call not expected on a IComponentAssignedModel"); } @Override public final void setObject(T object) { throw new RuntimeException("set object call not expected on a IComponentAssignedModel"); } @Override public void detach() { } @Override public IWrapModel wrapOnAssignment(Component component) { return new AssignedInheritedPropertyModel(property, component); } private class AssignedInheritedPropertyModel implements IWrapModel { private String property; private Component owner; public AssignedInheritedPropertyModel(String property, Component owner) { this.property = property; this.owner = owner; } @Override public IModel getWrappedModel() { return InheritedPropertyModel.this; } @SuppressWarnings("unchecked") public W getTarget() { return (W)this.owner.getParent().getInnermostModel().getObject(); } @SuppressWarnings("unchecked") @Override public W getObject() { final W target = getTarget(); if (target != null) { return (W)PropertyResolver.getValue(this.property, target); } return null; } @Override public void setObject(W object) { PropertyResolverConverter prc = null; prc = new PropertyResolverConverter(Application.get().getConverterLocator(), Session.get().getLocale()); PropertyResolver.setValue(this.property, getTarget(), object, prc); } @Override public void detach() { } } private class AttachedInheritedPropertyModel implements IWrapModel { @Override public IModel getWrappedModel() { return InheritedPropertyModel.this; } @Override public T getObject() { return InheritedPropertyModel.this.getObject(); } @Override public void setObject(T object) { InheritedPropertyModel.this.setObject(object); } @Override public void detach() { InheritedPropertyModel.this.detach(); } } } public class InheritedChainingModel implements IChainingModel, IComponentInheritedModel { private Object target; public InheritedChainingModel(final Object object) { this.target = object; } @Override public IModel getChainedModel() { if (target instanceof IModel) { return (IModel)target; } return null; } @Override public void setChainedModel(IModel model) { target = model; } @SuppressWarnings("unchecked") @Override public T getObject() { if (target instanceof IModel) { return ((IModel)target).getObject(); } return (T)target; } @SuppressWarnings("unchecked") @Override public void setObject(T object) { if (target instanceof IM
Re: IComponentAssignedModel and ComponentModel
ok, this is kind of embarassing. i subscribed to the list, but i didnt get any feedback if it was successful. i post a message to the mailinglist, no feedback again. i look in nabble, my mail isnt there. what am i supposed to think? so i subscribed again and again with little differences and everytime i sent a new email. nothing happened. i cant know that nabble takes 10 hours to list a mail that was send to the list. why not just using a forum? its the successor of mailinglists. :D ok back to topic. why wrap the model if i just want to assign the component, that the model is assigned to. why not just set a property on the model itself? why wrap the model itself? -- View this message in context: http://www.nabble.com/IComponentAssignedModel-and-ComponentModel-tp25593781p25605171.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
IComponentAssignedModel and ComponentModel
hi, i have a question regarding implementation details of wicket. IComponentAssignedModel is used to make a model aware of the component its assigned to. ComponentModel is a quick implementation of this interface. why is it done with an inner class? why not just have an attribute on the "outer" class and assign the component to it in wrapOnAssignment(Component component)? why an inner class? thanks in advance, garz (just want to learn) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
IComponentAssignedModel and ComponentModel
hi, i have a question regarding implementation details of wicket. IComponentAssignedModel is used to make a model aware of the component its assigned to. ComponentModel is a quick implementation of this interface. why is it done with an inner class? why not just have an attribute on the "outer" class and assign the component to it in wrapOnAssignment(Component component)? why an inner class? thanks in advance, garz (just want to learn) -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
IComponentAssignedModel and ComponentModel
hi, i have a question regarding implementation details of wicket. IComponentAssignedModel is used to make a model aware of the component its assigned to. ComponentModel is a quick implementation of this interface. why is it done with an inner class? why not just have an attribute on the "outer" class and assign the component to it in wrapOnAssignment(Component component)? why an inner class? thanks in advance, garz (just want to learn) -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
IComponentAssignedModel and ComponentModel
hi, i have a question regarding implementation details of wicket. IComponentAssignedModel is used to make a model aware of the component its assigned to. ComponentModel is a quick implementation of this interface. why is it done with an inner class? why not just have an attribute on the "outer" class and assign the component to it in wrapOnAssignment(Component component)? why an inner class? and how i'm supposed to use ComponentModel as a base class when i cant subclass the innerclass because its private and therefor not visible? thanks in advance, garz -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
IComponentAssignedModel and ComponentModel
hi, i have a question regarding implementation details of wicket. IComponentAssignedModel is used to make a model aware of the component its assigned to. ComponentModel is a quick implementation of this interface. why is it done with an inner class? why not just have an attribute on the "outer" class and assign the component to it in wrapOnAssignment(Component component)? why an inner class? and how i'm supposed to use ComponentModel as a base class when i cant subclass the innerclass because its private and therefor not visible? thanks in advance, garz -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panel not using generics
i want the getModelObject() (which is in fact the getDefaultModelObject()) to return the actual type that i dont need to do unchecked casts. i'm just wondering, now that everything uses generics, why does the panel do not use generics? just want to understand the reason behind this. regards garz reiern70 wrote: > > What's the meaning you want to attach to the "missing" generic parameter? > Best, > > Ernesto > > On Wed, Sep 9, 2009 at 12:23 PM, Kurt Zitze wrote: > >> hey, >> >> why does the panel is not using generics for type safety? >> >> regards >> -- >> Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 >> - >> sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > -- View this message in context: http://www.nabble.com/Panel-not-using-generics-tp25362188p25362915.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org