This content has been marked as final.
Show 2 replies
-
1. Re: Changing Seam component properties via Remoting
shane.bryzak Jul 23, 2007 9:33 AM (in response to dkane)Seam's bijection features should work just the same within a remoting call as they do with a faces request. Can you please post some code showing what you're trying to do?
-
2. Re: Changing Seam component properties via Remoting
dkane Jul 23, 2007 9:52 AM (in response to dkane)There is a lot of code, so only key points :
Seam Component interface :@Local public interface MapImageA4J { public void setXc(int xc); public int getXc(); public void setYc(int yc); public int getYc(); public void setWidth(int width); public int getWidth(); public void setHeight(int height); public int getHeight(); public void setScale(int scale); public int getScale(); public void drawImage(OutputStream out, Object data) throws Exception; @WebRemote public void zoom(double xPercent, double yPercent, double widthPercent, double heightPercent); // this method is being called via Remoting and changes values of properties xc, yc, scale, etc. public void left(); public void right(); public void up(); public void down(); public void zoomIn(); public void zoomOut(); public void destroy(); }
Web - page fragment :<s:link action="#{map.left}" value="left"/><br/> <s:link action="#{map.right}" value="right"/><br/> <s:link action="#{map.up}" value="top"/><br/> <s:link action="#{map.down}" value="bottom"/><br/> <s:link action="#{map.zoomIn}" value="zoom in"/><br/> <s:link action="#{map.zoomOut}" value="zoom out"/><br/> <!-- links above works fine and image is being rerendered --> <a4j:mediaOutput id="a4map" element="img" cacheable="false" session="true" createContent="#{map.drawImage}" mimeType="image/gif" onmousedown="mapStartZoom(event)" onmousemove="mapMouseMove(event)" onmouseup="mapMouseUp(event)" />
And, the problem point : end of "onmouseup" handler (Javascript):function mapStopZoom(evt) { //... some calculation ... Seam.Component.getInstance("map").zoom(xLeftPercent,yTopPercent,widthPercent,heightPercent); }
zoom method is being called via Remoting, but when I click e.g. "up" or "down" after zoom results falls back.
I've raised the similar issue in ajax4jsf forum, because I beleive the problem is impossibility to rerender mediaOutput right after remoting call.
So far have not found a way to rerender a4j object from plain JavaScript.
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066643#4066643