I have to display a custom build Image generated by another API.  The way I
hae thought of it right now is by extending RenderedDynamicImageResource.
Here is the way I work with it :
Create a panel containing an Image with the blank ressource.  Then, clicking
on a link, I refresh the panel, which should also refresh the image to
reflect the change.  The problem is that whatever happen, the render of the
graph is not called.  I mean, I set Height and width correctly, but the
image does not rerender.  It is possible that RenderedDynamicImageRessource
is not Ajax ready and if so, what can I use?

Here is the panel :
   public GraphToDiplay(String id) {
       super(id);
       _graphImageRessource = new GraphImageRessource();
       Image graph = new NonCachingImage("graph", new
ProcessGraphImageRessource());
       graph.setOutputMarkupId (true);
       add(graph);
   }
   public void onAttach()
   {
       Graph graph = getGraph();
       _graphImageRessource.setGraph (graph);
   }
Here is the Ressource :
   public ProcessGraphImageRessource()
   {
       super(3, 3);
   }
   public void setGraph(Graph graph)
   {
       _graph = graph;
       setWidth(graph.getWidth ());
       setHeight(graph.getHeight ());
       invalidate();
       System.out.println("Setting height{" + graph.getHeight () + "} and
width{" + graph.getWidth () + "}");
   }
   protected boolean render (Graphics2D graphics2D)
   {
       System.out.println("Rendering");
       if(_graph != null)
       {
           if(_graph.getWidth () == this.getWidth () && _graph.getHeight ()
== this.getHeight ())
           {
               System.out.println("Suppose to paint this graph now...");
               _graph.paintVisibleContent (graphics2D);
               return true;
           }
           else
           {
               this.setWidth (_graph.getWidth ());
               this.setHeight(_graph.getHeight ());
               return false;
           }
       }
       else
       {
           return true;
       }
   }


Thanks in advance

Marc
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to