How does the "onrowclick" work for a subfile?

Use this board to ask questions or have discussions with other Genie users.
Post Reply
rmarsh
Profound User
Posts: 56
Joined: Tue Jan 20, 2015 4:28 pm
First Name: Raymond
Last Name: Marsh
Company Name: Cracker Barrel Old Country Sto
Phone: 615-235-4215
Address 1: PO Box 787
City: Lebanon
State / Province: Tennessee
Zip / Postal Code: 37088
Country: United States
Contact:

How does the "onrowclick" work for a subfile?

Post 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 643 times
Genie Subfile<br />Genie subfile
Genie Subfile
Genie subfile
scn2subfileGenie.JPG (32.75 KiB) Viewed 643 times
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

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

Post 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
rmarsh
Profound User
Posts: 56
Joined: Tue Jan 20, 2015 4:28 pm
First Name: Raymond
Last Name: Marsh
Company Name: Cracker Barrel Old Country Sto
Phone: 615-235-4215
Address 1: PO Box 787
City: Lebanon
State / Province: Tennessee
Zip / Postal Code: 37088
Country: United States
Contact:

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

Post by rmarsh »

Perfect, thanks. I was wondering if it was row or some other value. Makes sense and works well.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest