Page 1 of 1

How does the "onrowclick" work for a subfile?

Posted: Fri Feb 13, 2015 5:07 pm
by rmarsh
What I'd like to do is enter an 'X' in the input field for the corresponding row that is clicked. I have hidden the input field and want to use the mouse to click a row, enter an 'X' and press enter.

This is how I do it with normal input/output fields in Genie:
onclick event for the output field.

Code: Select all

changeElementValue("I_14_76", "X"); 
pressKey("Enter");
5250 Screen
5250 Screen
scn2subfile5250.JPG (31.84 KiB) Viewed 679 times
Genie Subfile<br />Genie subfile
Genie Subfile
Genie subfile
scn2subfileGenie.JPG (32.75 KiB) Viewed 679 times

Re: How does the "onrowclick" work for a subfile?

Posted: Fri Feb 13, 2015 6:02 pm
by Scott Klement
The changeElementValue (or pui.set(), which is the same thing) and pressKey() are the way to do this as well.

When your onrowclick is called, it'll be passed a variable named 'row' that you can use to calculate the element name. The 'row' variable is the subfile row (not the screen row) but it can be used to calclate the screen row. For exanple, if the first line of your subfile on screen row 7, then you could do something like this:

Code: Select all

var widget = "I_" + (row+6) + "_76";
changeElementValue(widget, "X");
pressKey("Enter");
Since 'row' contains the subfile row, when the user clicks subfile row 1, it'l change "I_7_76", when the user clicks subfile row 2, it'll change "I_8_76", etc

Re: How does the "onrowclick" work for a subfile?

Posted: Mon Feb 16, 2015 3:05 pm
by rmarsh
Perfect, thanks. I was wondering if it was row or some other value. Makes sense and works well.