5 Replies Latest reply on Mar 23, 2009 1:13 PM by vsoneta

    Accessing AIRAliases.js in my air application

    vsoneta
      I have my air.htl as:

      <html>
      <head>
      <title>Dierbergs Web Applications</title>
      <script language="javascript" type="text/javascript" src="AIRAliases.js"></script>
      <script language="javascript">
      function init() {
      window.nativeWindow.addEventListener(air.Event.CLOSING, onClosingEvent);
      window.nativeWindow.maximize();
      }
      function onClosingEvent(event) {
      if (!confirm("Exit Dierbergs Web Applications? Any unsaved changes will be lost."))
      event.preventDefault();
      }

      </script>
      </head>
      <body onload="init()">
      <!-- Load into a frame to preserve the javascript in this file. -->
      <frameset rows="100%">
      <frame src=" http://hq1svrdev001/zkintranet/index.zul">
      </frameset>

      </body>
      </html>


      And in my application I want to use the below commands:
      var urlReq = new air.URLRequest(url);
      air.navigateToURL(urlReq);

      for eg my print.zul is :
      <zk>



      <window id="winBenryPrint"
      title="Print"
      sizable="false"
      closable="true"
      mode="overlapped"
      border="normal"
      style="overflow:hidden;"
      top="5px"
      left="10px"
      width="325px"
      height="175px"
      onClose="contractEditor.btnPrnClose()">

      <vbox width="100%" height="100%" align="center">
      <vbox>
      <label value="Select Report:"/>
      <hbox>
      <button id="btnPrnPrint" label="Print!" width="75px" action="onclick:oncall()"/>

      </hbox>
      <textbox id="txtPrnDescription" width="275px" rows="5"/>
      </vbox>
      </vbox>


      <html><![CDATA[

      <script type="text/javascript">
      function oncall(){
      var url = " http://elsa.berkeley.edu/";
      var urlReq = new air.URLRequest(url);
      air.navigateToURL(urlReq);
      }
      </script>
      ]]></html>

      </window>
      </zk>


      So my question is as AirAlliases.js is on my application level ie: After running an app this is the structure:


      --Zkintranet.exe
      --AIRAliases.js
      --zkinranet.html

      So what should be done so that in the <frame src=" http://hq1svrdev001/zkintranet/print.zul"> page so that I can access the shortcuts... I saw the http://help.adobe.com/en_US/AIR/1.1/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7f08. html which specifies for iframe but got confused as to how it would apply to my application.. So please if step by step is shown it would help...