Re: [1.4] override getObject() return type not the same with original model ?

2009-11-18 Thread smallufo
2009/11/18 Jeremy Thomerson jer...@wickettraining.com Well, you can't make a subclass a different parameterized type than it's parent. It won't work. You should be using an Integer model for this and using a converter rather than a nested model to make it a string. That's what converters

Re: [1.4] override getObject() return type not the same with original model ?

2009-11-18 Thread Jeremy Thomerson
http://cwiki.apache.org/WICKET/using-custom-converters.html -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 18, 2009 at 10:09 AM, smallufo small...@gmail.com wrote: 2009/11/18 Jeremy Thomerson jer...@wickettraining.com Well, you can't make a subclass a different

Re: [1.4] override getObject() return type not the same with original model ?

2009-11-18 Thread smallufo
2009/11/19 Jeremy Thomerson jer...@wickettraining.com http://cwiki.apache.org/WICKET/using-custom-converters.html Thanks a lot , this solves my problem... But , there is a more complicated situation : Old code : (works in 1.3) ListView poem = new ListView(poem , new PropertyModel(model ,

Re: [1.4] override getObject() return type not the same with original model ?

2009-11-18 Thread Jeremy Thomerson
ListView needs a model that has ListV, so do this: ListViewString poems = new ListViewString(poems, new AbstractReadOnlyModelListString() { public ListString getObject() { // here you put the code that takes the string and tokenizes it } }) { @Override protected void

[1.4] override getObject() return type not the same with original model ?

2009-11-17 Thread smallufo
Hi all I've already converted most of my code from 1.3 to 1.4 , except this situation : Label intToStringLabel = new Label(intToString , new PropertyModel(this , integer) { @Override public Object getObject() { int value = ((Integer)

Re: [1.4] override getObject() return type not the same with original model ?

2009-11-17 Thread Jeremy Thomerson
Well, you can't make a subclass a different parameterized type than it's parent. It won't work. You should be using an Integer model for this and using a converter rather than a nested model to make it a string. That's what converters are for. -- Jeremy Thomerson http://www.wickettraining.com

Re: [1.4] override getObject() return type not the same with original model ?

2009-11-17 Thread Igor Vaynberg
chain the two models: class numstringmodel extends abstractreadonlymodelstring { private final imodelinteger intmodel; public numstringmodel(imodelinteger intmodel) { this.intmodel=intmodel; } public string getobject() { int val=intmodel.getobject(); switch (val)