0

Fisheye disappears

asked 2010-11-02 03:59:41 +0800

Neus gravatar image Neus
1415 14

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>

Try clicking "Abrir Ventana" before 5 seconds have passed.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-02-14 10:54:50 +0800

Neus gravatar image Neus
1415 14

Can anyone try this and tell me the result?
Thank you!

link publish delete flag offensive edit

answered 2011-02-15 16:21:46 +0800

twiegand gravatar image twiegand
1807 3

updated 2011-02-15 16:22:53 +0800

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

link publish delete flag offensive edit

answered 2011-02-16 01:56:30 +0800

Neus gravatar image Neus
1415 14

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

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-11-02 03:59:41 +0800

Seen: 439 times

Last updated: Feb 16 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More