Hi, a workaround could be returning an empty 1px*1px image from your IResource. This way browsers won't complain with invalid content as you encounter.
Regards, __ Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>) http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr On Tue, Jul 16, 2013 at 10:53 PM, Stefan Renz <[email protected]> wrote: > Hi guys, > > I'm desparate for your help: I just can't figure out how to suppress an > Image in case its IResource yields nothing. > > Here's some context: > > A customer may have a custom logo image (in fact, there's some logic > involved in determining which exact logo to use, but that's beside the > point) located in some database. Using Wicket's Image component, I > figured I would need to implement the logo resolution algorithm and > loading from the DB with either subclassing DynamicImageResource, or > subclassing AbstractResourceStream (which is more approriate?). > > Works fine if a logo is there -- the image shows up. However, if there > _is_ no logo, the browser (firefox in my case) renders a question mark > instead of showing nothing. Both returning null or an empty byte array > doesn't matter. > > I usually suppress a component with a behavior, or within the > #onConfigure()-Method, but in the Image's case, where I only have an > IResource or ResourceReference, I just don't have a hint on how to > determine if the image data is there or not (apart from asking the > database _again_ for the data or presence thereof). > > Any ideas? What method/class have I missed? Where should I look? > > Thanks for your help. > Cheers > Stefan > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
