Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Submitted By: Paul Russell (paulrussell)
Assigned to: Nobody/Anonymous (nobody)
Summary: [Patch] R'Ref and Resource support in Image Models
The attached patch provides the ability to support providing resources
and resource references to images through their model, rather than
having to override Image.getImageResource or
Image.getImageResourceReference. This patch /should not/ change the
behaviour of any existing applications, since it only comes into play where
the model object supplied implements either ResourceReference or
Resource; previously any such models would have been interpreted as
strings, which would not have worked.
NOTE: This patch is against for wicket 1.2-SNAPSHOT from SVN. I will
forward port to 2.0 ASAP.
Summary of changes:
* Updated LocalizedImageResource.setSrcAttribute such that it resolves
the resource reference or resource from the image component's model.
Note that it does this for each request; the resulting resource is not
cached, so that it may be updated upon each request.
* Added two new images to wicket-examples, one providing a resource
reference via its model, and one providing a dynamic image resource.
mvn clean install on wicket-parent successful (after hacking profiles in
pom.xml to include standard wicket projects on JDK1.5 -- more on this
later!), and wicket-examples/images works as expected.