You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Oliver Mahnke <ol...@apliki.de> on 2008/09/15 18:35:26 UTC

No proper update of DynamicImageResource

Hi,

i want to display a list of images in a panel using DynamicImageResource.

The panel should be dynamically replaced by another instance of the same 
panel with an ajax callback.

The replacement of the panel works fine except for the images, which are 
not updated.


I noticed that populateItem() of the ListView is called when the new 
panel is inserted but getImageData() from DynamicImageResource is not 
called.

Is seems like the images in the replacement panel have exactly the same 
url. Could this be some resource-caching issue?

Can anybody help with this?

Thanks,

Oliver


the code looks as follows

add(
    new ListView("icons", icons) {

        @Override
        protected void populateItem(ListItem item) {
           
            final int imageId = ...
           
            item.add(
                new Image("image",
                    new DynamicImageResource() {

                        @Override
                        protected byte[] getImageData() {                
                                   
                            return dao.getImageData(imageId);
                        }
                    }
                )
            )
        }
    }
);




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: No proper update of DynamicImageResource

Posted by Korbinian Bachl - privat <ko...@whiskyworld.de>.
you need to use NonCachingImage instead IMHO...

Best,

Korbinian

Oliver Mahnke schrieb:
> Hi,
> 
> i want to display a list of images in a panel using DynamicImageResource.
> 
> The panel should be dynamically replaced by another instance of the same 
> panel with an ajax callback.
> 
> The replacement of the panel works fine except for the images, which are 
> not updated.
> 
> 
> I noticed that populateItem() of the ListView is called when the new 
> panel is inserted but getImageData() from DynamicImageResource is not 
> called.
> 
> Is seems like the images in the replacement panel have exactly the same 
> url. Could this be some resource-caching issue?
> 
> Can anybody help with this?
> 
> Thanks,
> 
> Oliver
> 
> 
> the code looks as follows
> 
> add(
>    new ListView("icons", icons) {
> 
>        @Override
>        protected void populateItem(ListItem item) {
>                      final int imageId = ...
>                      item.add(
>                new Image("image",
>                    new DynamicImageResource() {
> 
>                        @Override
>                        protected byte[] getImageData() {                
>                                                              return 
> dao.getImageData(imageId);
>                        }
>                    }
>                )
>            )
>        }
>    }
> );
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org