[ 
https://issues.apache.org/jira/browse/WICKET-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13120152#comment-13120152
 ] 

Ras Poutine commented on WICKET-3869:
-------------------------------------

I have the same error in 1.5.1 and internet explorer 8 when i run this code :

public void onClick(AjaxRequestTarget target) {
        replacePanel(target, new ImagePanel("panel", 
item.getModelObject().getName());
}
            
private void replacePanel(AjaxRequestTarget target, Panel newPanel) {
    this.dynamicPanel.replaceWith(newPanel);
    this.dynamicPanel = newPanel;
    target.add(this.dynamicPanel);
}

public class ImagePanel extends Panel {

        public ImagePanel(String id, String path) {
            super(id);
            setOutputMarkupId(true);
            final ResourceReference ref = getPicResource(new File(path));
            Image image = new Image("image", ref) {
                @Override
                protected void onComponentTag(final ComponentTag tag) {
                    CharSequence url = RequestCycle.get().urlFor(ref, new 
PageParameters());
                    checkComponentTag(tag, "img");
                    tag.put("src", url);
                    tag.put("alt", "");
                }
            };
            add(image);
        }
}

public ResourceReference getPicResource(final File pic) {

        return new ResourceReference(pic.getName()) {

            @Override
            public AbstractResource getResource() {
                final BufferedDynamicImageResource resource = new 
BufferedDynamicImageResource();
                BufferedImage bi = null;
                try {
                    bi = ImageIO.read(im);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                resource.setImage(bi);
                return resource;
            }
        };
}
                
> ResponseIOException when ajax response contains resource reference
> ------------------------------------------------------------------
>
>                 Key: WICKET-3869
>                 URL: https://issues.apache.org/jira/browse/WICKET-3869
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC5.1
>         Environment: Internet Explorer
>            Reporter: Sodasmile
>            Assignee: Martin Grigorov
>              Labels: ResponseIOException, explorer, internet
>             Fix For: 1.5-RC6
>
>         Attachments: internetexplorer-requests.png, iwicket-no-image.tgz, 
> iwicket.zip, lazyloaderror.zip
>
>
> When ajax response (show modal window) contains shared image response, server 
> log reports ResponseIOException.
> See attached example application. Using maven, type mvn package jetty:run. 
> Open http://localhost/8080/iwicket/ in Internet Explorer, click the link, 
> watch server log (may need to open/close modal window a few times, but 
> usually appears on first attempt). 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to