Hi

Im trying to use shared resources. I load them in wicketapplication.init, a similar approach works for me in 1.3, however in 1.4m3 I get null resources when I grab them from shared resources.

I can see that the resource are actually bound when I call bind..

The code:


   public static void LoadImages() {

       for (IconType iconType : IconType.values()) {

           ResourceReference consertIconRef = new ResourceReference(
                   Icons.class, iconType.getName());
           consertIconRef.bind(WicketApplication.get());
           log.debug("binding icon to:" + iconType.getName());
WicketApplication.get().getSharedResources().add(iconType.getName(),
                   consertIconRef.getResource());

       }

   }

   public static Image getImageForIcon(String id, IconType iconType) {
       log.debug("getting image for:" + iconType.getName());
Resource resource = WicketApplication.get().getSharedResources().get(
               iconType.getName());
       if (resource == null) {
           log.error("got null resource for :" + iconType.getName());
       }

       return new Image(id, resource);
   }

--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to