Clicked Column Name of an offline form
Clicked Column Name of an offline form
Is there a way to determine the column name that was clicked in the js file the executes as part of an offline form ?
-
MarkDuignan
- Posts: 346
- Joined: Wed Apr 18, 2012 10:33 am
Re: Clicked Column Name of an offline form
I think might be how you find out ...............
http://www.longrangemobile.com/docs/lrp ... raises.htm
Note the hierarchy note at the end as it's probably significant here.
This is the RPG documentation - but RDMLX programs and offline forms would access the same property.
http://www.longrangemobile.com/docs/lrp ... raises.htm
Note the hierarchy note at the end as it's probably significant here.
This is the RPG documentation - but RDMLX programs and offline forms would access the same property.
Re: Clicked Column Name of an offline form
I need to be able to access the information in a .js file that executes as part of the function, the information given only shows how to access the information in RPG or RDML.
-
tsupartono
- Posts: 289
- Joined: Wed Apr 18, 2012 10:21 am
Re: Clicked Column Name of an offline form
Hi Bill,
If you are handling the 'OnRowClick' event, unfortunately there is no way to find out which column the user tapped.
Instead, you might want to handle the 'OnClick' event of the column.
In your ExecScript operation, you can pass an argument that indicates which column triggers the execution of the script.
An example below (in pseudocode) assumes that you have a table called "MyTable", and two columns that when clicked will execute a script and pass an argument called "COL" (args.COL). The first column will pass "FirstName", and the second will pass "Surname".
Note: if you use RDMLX, you may want to set the properties using direct access if you find it more convenient. Please see http://www.longrangemobile.com/docs/lan ... inglon.htm
Then in your ECL JavaScript, you can read the argument by referencing "args.COL", like so:
Let us know how you go with this.
If you are handling the 'OnRowClick' event, unfortunately there is no way to find out which column the user tapped.
Instead, you might want to handle the 'OnClick' event of the column.
In your ExecScript operation, you can pass an argument that indicates which column triggers the execution of the script.
An example below (in pseudocode) assumes that you have a table called "MyTable", and two columns that when clicked will execute a script and pass an argument called "COL" (args.COL). The first column will pass "FirstName", and the second will pass "Surname".
Code: Select all
Using ("Form.Fields")
Using ("MyTable")
Using ("Col%1.Content")
Using ("OnClick.Operation")
SetProperty ("Type", "ExecScript")
SetProperty ("Args.COL", "FirstName")
EndUsing
EndUsing
Using ("Col%2.Content")
Using ("OnClick.Operation")
SetProperty ("Type", "ExecScript")
SetProperty ("Args.COL", "Surname")
EndUsing
EndUsing
Then in your ECL JavaScript, you can read the argument by referencing "args.COL", like so:
Code: Select all
lrexec (
function()
{
var col = args.COL;
if (col == "FirstName") . . .
else if (col == "Surname") . . .
}, ...
Re: Clicked Column Name of an offline form
That worked, thanks for your assistance.