Ok, maybe you are right that adding such method to PropertyModel will make it
bloated, but I think that some model dedicated to work with maps(MapModel ?)
will be nice feature of Wicket.

I know that questions bellow dont stick to the subject of this thread but
maybe you can help me with them. Recently i started to 'study' Wicket API
and Wicket sources and have two questions(so far ;)):

1)What IChainingModel interface is for ? I thought that it will be used
inside model implementations in getObject method checkig if nested model
object is a ChainingModel object but the instance of operator in this
methods checks against IModel interface (what is correct). If I understand
Wicket API correctly it is possible to implement some model with chainnig
ability without implementing IChaininig model - its internal implementation
of get/setObject methods. Could you explain me what I(or rather my model)
gain when my model implements IChaininigModel interface ?

2)When I looked at getTarget() method inside  PropertyModel class I found
that retriving of model object is done inside a loop. I dont understand why
PropertyModel cares about how nested model is implemented. Why it cares ?
because it checks if object returned but nested model is another nested
model or not. I thought that retriving of model object is responisbility of
each model class individually and PropertyModel should only check if its
model object is IModel object (if so return
((IModel)myModelObject).getObject) or is it a 'real' model object(if so
return it).

Answers for this questions will help me implementing my MapModel class.

Tanks for your help,
Regards Daniel


igor.vaynberg wrote:
> 
> why? because propertymodel is a convinience class only. once we start
> adding things like this into it it will get bloated. it is pretty easy
> to roll your own implementing imodel directly.
> 
> -igor
> 
> On Tue, Sep 30, 2008 at 10:53 AM, dlipski <[EMAIL PROTECTED]>
> wrote:
>>
>> If there is no option to force (why? I can imagine setMapKeyClass method
>> in
>> PropertyModel...) PropertyModel to do this and I have to use different
>> Model, I would like to ask does Wicket(or one of Wicket subprojects such
>> as
>> WicketExtensions) provide such ready to use model ?
>>
>> Daniel Lipski
>>
>> igor.vaynberg wrote:
>>>
>>> dont use a property model, roll your own
>>>
>>> -igor
>>>
>>> On Tue, Sep 30, 2008 at 8:31 AM, dlipski <[EMAIL PROTECTED]>
>>> wrote:
>>>>
>>>> Hi
>>>>
>>>> Im trying to 'force' PropertyModel to put into map key different then
>>>> String
>>>> but after few trials I have no idea how to do this.
>>>>
>>>> Example:
>>>> I have field myMap in my page initialized as follows:
>>>>
>>>> Map<Long, Boolean> myMap = new HashMap<Long, Boolean>();
>>>>
>>>> then I create property model for my page(this == page containing myMap
>>>> field):
>>>> PropertyModel p = new PropertyModel (this, "myMap[123]");
>>>>
>>>> now when I execute:
>>>> p.setObject(true);
>>>> model puts into map expected boolean but key is of type String not
>>>> Long.
>>>> How I can force this property model to put with key of choosen class
>>>> (in
>>>> this example Long)?
>>>>
>>>> Regards
>>>> Daniel Lipski
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/PropertyModel-type-of-key-map-tp19744489p19744489.html
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/PropertyModel-type-of-key-map-tp19744489p19747226.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/PropertyModel-type-of-key-map-tp19744489p19755807.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to