Re: PropertyModel with x.y as property name (from a properties file)

2012-01-10 Thread James Carman
or don't use cpm
On Jan 10, 2012 11:10 AM, "Sven Meier"  wrote:

> Write you own model:
>
> public class PropertiesModel extends AbstractReadOnlyModel {
>
>  private Properties properties;
>
>  private String key;
>
>  // constructor ...
>
>  public String getObject() {
>return properties.get(key);
>  }
> }
>
> You can implement IComponentInheritedModel if you want to have the same
> magic supported by CompoundPropertyModel, e.g.:
>
> Form form = new Form("form", new MyPropertiesModel(properties))**;
> form.add(new TextField("body.**background-color"));
>
> Hope this helps
> Sven
>
> Am 10.01.2012 15:44, schrieb Decebal Suiu:
>
>> Hello
>>
>> I have a form with new CompoundPropertyModel<**ValueMap>(properties) as
>> model
>> where properties are loaded from a properties file (legacy). My problem is
>> that in properties file I have keys like x.y
>> and I cannot use form.add(new TextField("body.**
>> background-color"));
>>
>> How do I solve this problem?
>>
>> Thanks,
>> Decebal
>>
>> --
>> View this message in context: http://apache-wicket.1842946.**
>> n4.nabble.com/PropertyModel-**with-x-y-as-property-name-**
>> from-a-properties-file-**tp4282146p4282146.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@wicket.**apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: PropertyModel with x.y as property name (from a properties file)

2012-01-10 Thread Sven Meier

Write you own model:

public class PropertiesModel extends AbstractReadOnlyModel {

  private Properties properties;

  private String key;

  // constructor ...

  public String getObject() {
return properties.get(key);
  }
}

You can implement IComponentInheritedModel if you want to have the same 
magic supported by CompoundPropertyModel, e.g.:


Form form = new Form("form", new MyPropertiesModel(properties));
form.add(new TextField("body.background-color"));

Hope this helps
Sven

Am 10.01.2012 15:44, schrieb Decebal Suiu:

Hello

I have a form with new CompoundPropertyModel(properties) as model
where properties are loaded from a properties file (legacy). My problem is
that in properties file I have keys like x.y
and I cannot use form.add(new TextField("body.background-color"));

How do I solve this problem?

Thanks,
Decebal

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PropertyModel-with-x-y-as-property-name-from-a-properties-file-tp4282146p4282146.html
Sent from the Users forum 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




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



PropertyModel with x.y as property name (from a properties file)

2012-01-10 Thread Decebal Suiu
Hello

I have a form with new CompoundPropertyModel(properties) as model
where properties are loaded from a properties file (legacy). My problem is
that in properties file I have keys like x.y
and I cannot use form.add(new TextField("body.background-color"));

How do I solve this problem?

Thanks,
Decebal

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PropertyModel-with-x-y-as-property-name-from-a-properties-file-tp4282146p4282146.html
Sent from the Users forum 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