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

The "import Classes" directive doesn't work for zscript

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.0
    • Fix Version/s: 6.5.1
    • Component/s: General
    • Labels:

      Description

      The import Classes directive works for apply attribute.
      But it doesn't work for zscript.

      ZUL
      <?import foo.*?>
      <zk>
      	<window border="normal" width="200px" apply="MyComposer"> <!-- works here -->
      		<label id="msg" />
      		<zscript><![CDATA[
      			MyBean myBean = new MyBean(); // but throws exception here
      			msg.setValue(myBean.getHello());
      		]]></zscript>
      	</window>
      </zk>
      
      foo.MyBean
      package foo;
      
      public class MyBean {
      	public String getHello() {
      		return "hello";
      	}
      }
      
      foo.MyComposer
      package foo;
      
      import org.zkoss.zk.ui.select.SelectorComposer;
      import org.zkoss.zul.Window;
      
      public class MyComposer extends SelectorComposer<Window> {
      	private static final long serialVersionUID = 1L;
      
      	@Override
      	public void doAfterCompose(Window win) throws Exception {
      		super.doAfterCompose(win);
      		win.setTitle("hello");
      	}
      }
      

      By the way, this is no error:

      ZUL2
      <zk>
      	<zscript><![CDATA[
      			import foo.*;
      	]]></zscript>
      	<window border="normal" width="200px" apply="MyComposer">
      		<label id="msg" />
      		<zscript><![CDATA[
      			MyBean myBean = new MyBean(); 
      			msg.setValue(myBean.getHello());
      		]]></zscript>
      	</window>
      </zk>
      

        Attachments

          Activity

            People

            Assignee:
            vincentjian vincentjian
            Reporter:
            paowang paowang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: