JScript works in ArcPad desktop but not mobile

784
4
11-01-2016 09:58 AM
SeanJeronimo
New Contributor

I've written a pretty simple script for an ArcPad form. It is basically just one event handler that does a calculation when data is entered in a particular field and a couple others that give warning messageboxes if entered values seem suspicious. It works just fine on the desktop version of ArcPad, but when I deploy it onto a mobile device none of the scripts are ever called. In both cases this is ArcPad 10.2.

Is there some setting on the mobile device that I have to enable to allow scripts to run? Are there some differences between the scripting objects available in mobile vs. desktop? Or something else I'm missing?

Any clues are appreciated.

Tags (1)
0 Kudos
4 Replies
IngridHogle
Occasional Contributor

Did you specify the script language within your script? If you are using This ArcPad Script Element help page might be useful.

If you are using an axf checkout, here are the steps as outlined by ESRI's Kevin Burke at the 2016 Users Conference:

1. In ArcPad Studio, first create a new VBS, JS, or Python script file and save it to the same folder directory as the AXF.
2. Open the AXF and corresponding APL in ArcPad Studio.
3. At the top of the APL file, right-click on the <LAYER> [LayerName] element at the top.
4. Choose ‘Add Element’ and type ‘SCRIPT’ and click OK.
5. Right-click on the newly added <SCRIPT> element and choose ‘Add Attribute’.
6. For Name, enter ‘src’. Click OK. This represents the source of the script file. (The value will be populated in a later step)
7. Double-click on ‘src’ and browse to the script file added in Step 1.
8. Follow Steps 5 & 6 again, however for the Name, enter ‘language’. For the value, enter in the language being used. i.e. vbscript, jscript, etc.
9. Finally, to begin writing the code, double-click on the <SCRIPT> element to open the file.
10. For additional documentation, in ArcPad Studio go to Help > Help. The Customizing ArcPad Help dialog opens. In the Search tab, type vbscript and then choose ‘SCRIPT Element’ in the list.

0 Kudos
SeanJeronimo
New Contributor

Thanks for the suggestions, Ingrid. Yes, I do specify the script language, and no, I am not using AXF. The APL file looks like this:
<ArcPad compiled="true">
   <LAYER name="Plot_Template.shp">
      <FORMS>
         <EDITFORM name="EDITFORM" caption="Edit" width="130" height="130" attributespagevisible="false" symbologypagevisible="false" geographypagevisible="false" picturepagevisible="true" required="false" onload="onFormLoad()">
            ...
         </EDITFORM>
         <IDENTIFYFORM name="IDENTIFYFORM" caption="Identify" width="130" height="130" picturepagevisible="true" attributespagevisible="true" symbologypagevisible="true" geographypagevisible="true" required="false">
            ...
         </IDENTIFYFORM>
      </FORMS>
   </LAYER>
   <SCRIPT language="JScript" src="Plot_Template.js"/>
</ArcPad>

Then the JS file contains the callback functions.

Would using AXF potentially improve the situation?

0 Kudos
IngridHogle
Occasional Contributor

Although I don't have experience with using JScript or writing scripts for shapefiles, it looks like you've done everything correctly. I don't know if using AXF would help, but it's fairly easy to try by selecting this option during the checkout process and then editing in ArcPadStudio. If your script is simple enough to convert to the default vbscript, that might be a good option to try too.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

<SCRIPT language="JScript" src="Plot_Template.js"/>

Sean, maybe a long shot, but make sure that the mobile device can see you .js file.  I know I had to change paths when moving one of my projects from a desktop to a mobile since paths, like "my docs" etc changed location and/path.  It maybe looking for the file in the wrong location.

0 Kudos