Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1136

Clients.showNotification(String) throws JS error when used with Include in defer mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.0.2
    • 6.0.1
    • Components
    • Security Level: Jimmy
    • None

    Description

      Test case
      Main.zul

      <zk>
      	<window id="win_main" title="Hello Notification!!" border="normal"
      		width="100%">
      		<button label="show notification " autodisable="self">
      			<attribute name="onClick">
      						<![CDATA[
      	Window win = (Window) Executions.getCurrent().createComponents(
      			"winmodal.zul", null, null);
      	win.addEventListener(Events.ON_CLOSE, new org.zkoss.zk.ui.event.EventListener() {
      		public void onEvent(Event event) throws Exception {
      			Clients.showNotification("ok 1", Clients.NOTIFICATION_TYPE_INFO,
      					win_main, "top_right", -1);
      			Clients.showNotification("ok 2");
      		}
      	});
      	win.doModal();
      ]]></attribute>
      		</button>
      	</window>
      </zk>
      

      winmodal.zul

      <zk>
      	<window id="win_modal" title="win modal!!" width="924px"
      		height="568px" border="normal" closable="true">
      		<vlayout spacing="2px">
      			<include src="incdefer.zul" mode="defer" progressing="true"
      				arg_win_main="${win_modal}" />
      		</vlayout>
      	</window>
      </zk>
      

      incdefer.zul

      <zk>	
      	<window id="win_inc_defer" title="include mode defer" border="normal" width="100%">
      		<separator spacing="10px"/> 		
      		<button label="Close me" autodisable="self">
      			<attribute name="onClick">
      				<![CDATA[
      				    Window win_main = (Window ) self.getAttribute("arg_win_main");
      					Events.postEvent(new Event(Events.ON_CLOSE, win_main, null));					
      				]]>						
      			</attribute>
      			<custom-attributes arg_win_main="${requestScope.arg_win_main}"/>			
      		</button>
      	</window>
      </zk>
      

      Expected: After closing modal window the notification should display correctly
      Actual: Global notification fails and shows a JS error on browser (All browsers)

      Attachments

        Activity

          People

            vincentjian vincentjian
            ashishd ashishd
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: