0

Problem with modal window

asked 2010-10-25 03:24:55 +0800

Neus gravatar image Neus
1415 14

Hi,

I have a window X with a button that calls a modal window Y . Inside that second window I have another modal window.
When I click the button the first time all works ok. But the second time the modal window Y appears at the bottom of the window X and all the page appears disabled.

I have made an example code:

This is the window with the button:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<borderlayout width="1024px" height="1000px">
	<center>
		<panel>
			<panelchildren>
				<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>
			</panelchildren>
		</panel>	
	</center>
</borderlayout>
</zk>

And it calls this window:
NuevaVentana.zul

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="VentanaIncidencia" title="Nueva Ventana" border="normal" mode="modal" 
			defaultActionOnShow="moveDiagonal" closable="true" position="center" onClose="VentanaObservacionesTarea.detach()">
			
	<button label="Ventana Observaciones" onClick="VentanaObservacionesTarea.doModal()"/>
</window>
<window id="VentanaObservacionesTarea" visible="false" title="_Observaciones de la tarea" width="400px" height="200px" closable="false" defaultActionOnShow="moveDiagonal" position="center">
	 Hola
 
   </window>
</zk>

It only happens when the modal window have another modal window inside. I have try it with ZK3.6.3, ZK5.0.0, ZK5.0.4 and it works OK. Now I'm using the evaluation version of ZK EE 5.0.4. It only fails with this version.

The defaultActionOnShow=moveDiagonal" neither works.

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2010-10-26 01:39:04 +0800

Neus gravatar image Neus
1415 14

Is not happening to anyone else?

link publish delete flag offensive edit

answered 2010-10-31 21:33:15 +0800

PeterKuo gravatar image PeterKuo
481 2

You may look at the javadoc of setDefaultActionOnShow.
It's deprecated.

void org.zkoss.zul.Window.setDefaultActionOnShow(String onshow)

Deprecated. As release of 5.0.0, replaced with JavaScript overriding. Sets the action of window component to show the animating effect by default.

Default: null. In other words, if the property is null, it will refer to the configuration of zk.xml to find the preference with "org.zkoss.zul.Window.defaultActionOnShow", if any. For example,

<preference>
<name>org.zkoss.zul.Window.defaultActionOnShow</name>
<value>slideDown</value>
</preference>

Parameters:
onshow the action to take when showing up a window
Since:
3.0.2

link publish delete flag offensive edit

answered 2010-11-02 02:44:37 +0800

Neus gravatar image Neus
1415 14

ok, thank you.
And have you try the other thing that is happening only with the evaluation version?

I have a window X with a button that calls a modal window Y . Inside that second window I have another modal window.
When I click the button the first time all works ok. But the second time, after closing the modal window with the navigator closing button, the modal window Y appears at the bottom of the window X and all the page appears disabled.

link publish delete flag offensive edit

answered 2010-11-03 20:38:33 +0800

PeterKuo gravatar image PeterKuo
481 2

when you close a window, it's actually detached.

Can you provide most simple code to reproduce the problem?

link publish delete flag offensive edit

answered 2010-11-04 02:50:41 +0800

Neus gravatar image Neus
1415 14

Yes, I know it is detached. But the second time you push the button to create it, it is not created well. It appears like disabled at the bottom of the window.
It only happens if the modal window you are calling with the button have another modal window in it. And only with the evaluation version of ZK 5.0.4 EE. I will like to attatch a photo but I don't know how...

The most simple code I could create (it's not very different from the provided above):
The main window with the button:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
	<window>
		<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>
	</window>
</zk>

The modal window with another modal window in it:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="VentanaIncidencia" title="Nueva Ventana" border="normal" mode="modal" 
			defaultActionOnShow="moveDiagonal" closable="true" position="center" onClose="VentanaObservacionesTarea.detach()">
			
	<button label="Ventana Observaciones" onClick="VentanaObservacionesTarea.doModal()"/>
</window>
<window id="VentanaObservacionesTarea" visible="false" title="_Observaciones de la tarea" width="400px" height="200px" closable="false" defaultActionOnShow="moveDiagonal" position="center">
	 Hola
 
   </window>
</zk>

link publish delete flag offensive edit

answered 2010-11-04 04:15:46 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-11-04 04:16:37 +0800

Instead:

      Window oWNuevaVentana = (Window) Executions.createComponents("NuevaVentana.zul", null,null);
	try {
		oWNuevaVentana.doModal();
	} catch (Exception e) {
	}

write:

	try {
               Window oWNuevaVentana = (Window) Executions.createComponents("NuevaVentana.zul", null,null);
		oWNuevaVentana.doModal();
	} catch (Exception e) {
	}

2. NuevaVentana.zul ???????
Which of the two window components inside should be showed modal?????


3. Separate the windows in single classes and you would have not this problems .

best
Stephan

link publish delete flag offensive edit

answered 2010-11-04 06:39:41 +0800

Neus gravatar image Neus
1415 14

If I separate the window in two classes it works fine.
But I think that if in the other versions of ZK it works well, it has to work well with the one that I'm using, too.

Thank you!

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-10-25 03:24:55 +0800

Seen: 1,049 times

Last updated: Nov 04 '10

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