Uploaded image for project: 'ZATS'
  1. ZATS
  2. ZATS-12

query string parameters to connected zul are null when retrieved through arg implicit object

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 1.1.0
    • 1.0.0
    • Mimic
    • None

      zats.zul

      <zk>
          <window title="hello" border="normal" width="300px" apply="org.zkoss.zats.sample.ZatsTestComposer">
              <label id="lbl1"/>
              <button id="helloBtn" label="Hello" />
          </window>
      </zk>
      
      ZatsTestComposer.java
      public class ZatsTestComposer extends SelectorComposer<Window> {
      
      	@Wire
      	Label lbl1;
          
      	@WireVariable
      	private Map arg;
      	
      	@Listen("onClick= #helloBtn")
          public void hello(Event evt) {
          	String a1 = (String) arg.get("arg1");
              lbl1.setValue(a1);
          }
      }
      
      ZatsTest.java
      ...
          @Test
          public void test() {
              DesktopAgent desktop = Zats.newClient().connect("/zats.zul?arg1=value1");
              ComponentAgent button = desktop.query("button");
              button.click();
              ComponentAgent label = desktop.query("label");
              assertEquals("value1", label.as(Label.class).getValue());
          }
      

      Expected: Test should pass. Implicit object arg should be correctly populated with the arguments passed when connecting to zul from ZatsTest
      Actual: Test fails. arg implicit object doesn't contain any arguments passed as query strings while connecting to zul page from ZatsTest
      Note: Doesn't work under ZK 5 environment either.

            paowang paowang
            ashishd ashishd
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: