aXes Mobile - How to add a button to Copy to Clipboard
Posted: 08 Aug 2014, 16:35
How to add a button to a project to use the mobile device's Copy to Clipboard feature
1) Open aXes development environment
2) Load your project in TS2 and navigate to the screen you wish to customise
Click on "Work as a TS2 Developer"
Signon to your session
Type on the command line: "addlible axesdemo" followed by enter
Type on the command line: "call xhrrpgtrn" followed by enter
Put an X next to to an employee
If you don't have a screen definition, press suggest and save the screen.
3) Add a PushButton
4) Edit caption. Change the caption value to "Copy address to clipboard"
5) Click on the "Screens" tab
Please note: This script uses the values of the fields Title, Street, City, State, Country, ZIP, PhoneNB and these names need to be defined in the screens tab of TS2 development environment for the relevant fields.
Change Fields Names to Title, LastName, FirstName, Street, City, State, Country, ZIP, PhoneNB.
6) Edit script
Copy and paste the script hereunder in the edit box.
7) You should now have a button on your screen which looks like this:
8) open aXes mobile and run your demonstration
1) Open aXes development environment
2) Load your project in TS2 and navigate to the screen you wish to customise
Click on "Work as a TS2 Developer"
Signon to your session
Type on the command line: "addlible axesdemo" followed by enter
Type on the command line: "call xhrrpgtrn" followed by enter
Put an X next to to an employee
If you don't have a screen definition, press suggest and save the screen.
3) Add a PushButton
4) Edit caption. Change the caption value to "Copy address to clipboard"
5) Click on the "Screens" tab
Please note: This script uses the values of the fields Title, Street, City, State, Country, ZIP, PhoneNB and these names need to be defined in the screens tab of TS2 development environment for the relevant fields.
Change Fields Names to Title, LastName, FirstName, Street, City, State, Country, ZIP, PhoneNB.
6) Edit script
Copy and paste the script hereunder in the edit box.
Code: Select all
if (window.LRSV)
{
var clipText = FIELDS("Title").getValue() + " " + FIELDS("LastName").getValue() + " " + FIELDS("FirstName").getValue() + "\r\n";
var clipText1 = FIELDS("Street").getValue()+ "\r\n";
var clipText2 = FIELDS("City").getValue()+ ", ";
var clipText3 = FIELDS("State").getValue()+ ", ";
var clipText4 = FIELDS("Zip").getValue()+ "\r\n";
var clipText5 = FIELDS("Country").getValue()+ "\r\n";
var clipText6 = FIELDS("PhoneNB").getValue()+ "\r\n";
var items = [ { text : clipText}, { text : clipText1}, { text : clipText2}, { text : clipText3}, { text : clipText4}, { text : clipText5}, { text : clipText6} ];
var options = { arrayItems:items } ;
try { LRSV.copyToClipboard( options ); }
catch (Error) { alert("problem in clipboard " + Error.message ); }
}
8) open aXes mobile and run your demonstration