-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have the same fisheye in two windows. After some seconds the fisheye changes. When it change, if I have both windows opened, it disappears.
I've made an example code:
PruebaVentanaModal.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <zscript> <![CDATA[ //@DECLARATION private void ActivarTimerNotas(Fisheye oFishEye, Panelchildren oBarraDestino){ org.zkoss.zul.Timer oTimerNotas = new org.zkoss.zul.Timer(); oTimerNotas.setRepeats(true); oTimerNotas.setDelay(5000); oTimerNotas.addEventListener("onTimer", new org.zkoss.zk.ui.event.EventListener() { public void onEvent(Event event) throws Exception { ComprovarNotas(oFishEye); } }); oTimerNotas.start(); oTimerNotas.setParent(oBarraDestino); } private static void ComprovarNotas(Fisheye oFishEye){ oFishEye.setStyle("border:thin solid red"); } ]]> </zscript> <borderlayout width="1024px" height="1000px"> <center> <panel> <panelchildren id="PanelCh"> <button label="Abrir Ventana"> <attribute name="onClick"><![CDATA[ Window oWNuevaVentana = (Window) Executions.createComponents("NuevaVentana.zul", null,null); try { oWNuevaVentana.doModal(); } catch (Exception e) { } ]]></attribute> </button> <toolbar> <fisheyebar itemHeight="32" itemMaxHeight="50" itemWidth="32" itemMaxWidth="50"> <fisheye id="FishEyeNotas" tooltiptext="Notas"> <attribute name="onCreate"><![CDATA[ ActivarTimerNotas(self,PanelCh); ]]></attribute> </fisheye> </fisheyebar> </toolbar> </panelchildren> </panel> </center> </borderlayout> </zk>
NuevaVentana.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <zscript> <![CDATA[ //@DECLARATION private void ActivarTimerNotas(Fisheye oFishEye, Panelchildren oBarraDestino){ org.zkoss.zul.Timer oTimerNotas = new org.zkoss.zul.Timer(); oTimerNotas.setRepeats(true); oTimerNotas.setDelay(5000); oTimerNotas.addEventListener("onTimer", new org.zkoss.zk.ui.event.EventListener() { public void onEvent(Event event) throws Exception { ComprovarNotas(oFishEye); } }); oTimerNotas.start(); oTimerNotas.setParent(oBarraDestino); } private static void ComprovarNotas(Fisheye oFishEye){ oFishEye.setStyle("border:thin solid red"); } ]]> </zscript> <window id="VentanaIncidencia" title=" " border="normal" mode="modal" closable="true" position="center"> <borderlayout height="300px" width="300px"> <center> <panel> <panelchildren id="PanelCh"> <toolbar> <fisheyebar itemHeight="32" itemMaxHeight="50" itemWidth="32" itemMaxWidth="50"> <fisheye id="FishEyeNotas" tooltiptext="Notas"> <attribute name="onCreate"><![CDATA[ ActivarTimerNotas(self,PanelCh); ]]></attribute> </fisheye> </fisheyebar> </toolbar> </panelchildren> </panel> </center> </borderlayout> </window> </zk>
Neus,
It appears that you are simply trying to put a thin, red box around your fisheye menu after 5 seconds. Is that correct? If so, why not use the <timer> component in your zul? Something like this:
PruebaVentanaModal.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <window> <borderlayout width="1024px" height="1000px"> <center> <panel> <panelchildren id="PanelCh"> <button label="Abrir Ventana"> <attribute name="onClick"><![CDATA[ Window oWNuevaVentana = (Window) Executions.createComponents("NuevaVentana.zul", null,null); try { oWNuevaVentana.doModal(); } catch (Exception e) { } ]]></attribute> </button> <toolbar height="80px"> <fisheyebar id="FishEyeNotas" tooltiptext="Notas" attachEdge="top" itemWidth="32" itemHeight="32" itemMaxHeight="64" itemMaxWidth="50"> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/FolderABlue-128x128.png" label="Folder" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/ReadingGlass-128x128.png" label="Reading Glasses" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/Briefcase-128x128.png" label="Project" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/MailboxFlag-128x128.png" label="Email" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/Globe-128x128.png" label="Globe" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/Spyglass-128x128.png" label="Spyglass" onClick="alert(self.label)" /> </fisheyebar> </toolbar> <timer id="timer" delay="5000" repeats="true"> <attribute name="onTimer"> FishEyeNotas.setStyle("border: thin solid red;"); </attribute> </timer> </panelchildren> </panel> </center> </borderlayout> </window> </zk>
NuevaVentana.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <window id="VentanaIncidencia" title=" " border="normal" mode="modal" closable="true" position="center"> <borderlayout height="300px" width="300px"> <center> <panel> <panelchildren id="PanelCh"> <toolbar height="80px"> <div id="myDiv"> <fisheyebar id="FishEyeNotas2" tooltiptext="Notas" attachEdge="top" itemWidth="32" itemHeight="32" itemMaxHeight="64" itemMaxWidth="50"> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/FolderABlue-128x128.png" label="Folder" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/ReadingGlass-128x128.png" label="Reading Glasses" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/Briefcase-128x128.png" label="Project" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/MailboxFlag-128x128.png" label="Email" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/Globe-128x128.png" label="Globe" onClick="alert(self.label)" /> <fisheye image="http://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/Spyglass-128x128.png" label="Spyglass" onClick="alert(self.label)" /> </fisheyebar> </div> </toolbar> <timer id="timer" delay="5000" repeats="true"> <attribute name="onTimer"> myDiv.setStyle("border: thin solid red;"); </attribute> </timer> </panelchildren> </panel> </center> </borderlayout> </window> </zk>
Maybe this will help a little.
Regards,
Todd
Really I'm not putting a red box around it, I'm changing the image after 5 seconds. But the effect is the same, it disappears (you can try it setting an image to fisheyes in my code).
I can't write the timer in my .zul because in my real application I create the fisheye via Java Code, and all windows share the same Java code to create the fisheye.
I think I'm not doing anything wrong...the effect is so strange.
Thank you Todd
Asked: 2010-11-02 03:59:41 +0800
Seen: 439 times
Last updated: Feb 16 '11