Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt
Hi, I'm trying to make an image subclass that shows an icon. Which icon it shows depends on its model object, which is a boolean. Problem is, I'm not getting the model object: it's always null. If I use a Label instead of InStockIconImage, it works: the label shows a boolean (true/false).

Re: Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt
Oops, I went a bit too far in pruning non-essential code. InStockIconImage has a second constructor: public InStockIconImage(String id) { super(id); } I think it centers around this. If I pass a PropertyModel(listingModel, inStock) explicitly to the constructor, it works, but

Re: Image subclass not getting its model object

2010-06-04 Thread Ernesto Reinaldo Barreiro
Maybe this is related to this override on Image class? @Override protected IModel? initModel() { // Images don't support Compound models. They either have a simple // model, explicitly set, or they use their tag's src or value //

Re: Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt
Hi Ernesto, Just got the 1.4.9 source code and I see what you mean. But why is it like this? I copied the whole Image source code to a new class, removed this initModel method, and then things work fine if I don't supply a model. Why would the Image component behave different from the other

Re: Image subclass not getting its model object

2010-06-04 Thread James Carman
I would say you need to use your own image resource, not subclass Image itself. On Fri, Jun 4, 2010 at 7:03 AM, Erwin Bolwidt ebolw...@worldturner.nl wrote: Hi Ernesto, Just got the 1.4.9 source code and I see what you mean. But why is it like this? I copied the whole Image source code to a

Re: Image subclass not getting its model object

2010-06-04 Thread Ernesto Reinaldo Barreiro
Hi Erwin, On Fri, Jun 4, 2010 at 1:03 PM, Erwin Bolwidt ebolw...@worldturner.nl wrote: Hi Ernesto, Just got the 1.4.9 source code and I see what you mean. As a rule I always install the source code of any OpenSouce software I use: Javadoc could be wrong or outdated but source code will never