You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Gerolf Seitz (JIRA)" <ji...@apache.org> on 2007/10/30 21:49:50 UTC

[jira] Resolved: (WICKET-1062) LocalizedImageResource does not serialize locale/style fields

     [ https://issues.apache.org/jira/browse/WICKET-1062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerolf Seitz resolved WICKET-1062.
----------------------------------

    Resolution: Fixed
      Assignee: Matej Knopp

seems like matej fixed this by removing "transient" in rev. 588200.
please reopen if necessary.

> LocalizedImageResource does not serialize locale/style fields
> -------------------------------------------------------------
>
>                 Key: WICKET-1062
>                 URL: https://issues.apache.org/jira/browse/WICKET-1062
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>            Reporter: John Ray
>            Assignee: Matej Knopp
>             Fix For: 1.3.0-beta5
>
>
> I have a page where clicking an AjaxLink causes an Image to be updated. In the onClick()  method of the link I change the image via setImageResourceReference(). I then call AjaxRequestTarget.addComponent(image) to have the image rendered.
> Everything works great when the page is first loaded however if I navigate to a different page and then back again the image doesn't update the first time I click the link. The problem is that the LocalizedImageResource saves the current locale/style in transient fields when it is first created. By navigating to a different page and then back again it causes the class to get serialized and the locale and style are initialized to null. In setSrcAttribute() this code then compares the locale against the image component's locale.
> Locale l = component.getLocale();
> String s = component.getStyle();
> if (resourceKind == null ||
> 	(!Objects.equal(locale, component.getLocale()) || !Objects.equal(style, component
> 			.getStyle())))
> {
> 	// Get new component locale and style
> 	locale = component.getLocale();
> 	style = component.getStyle();
> 	// Invalidate current resource so it will be reloaded/recomputed
> 	resourceReference = null;
> 	resource = null;
> }
> Since the local in LocalizedImageResource was not serialized it never matches and my call to setImageResourceReference() is basically ignored. 
> If you just remove the transient keyword from the locale and style fields it fixes the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.