Hi,
Is there a possibility to implement the "row" parameter for the selection in the choices parameter value ?
e.g.
choices selection criteria: tablefield1 = ?
choices parameter value: script:get("gridfield1." + row);
At the moment I got an error "row is not defined"
Thanks
subfile choices parameter value
-
- Profound User
- Posts: 24
- Joined: Thu Jul 24, 2014 6:52 am
- First Name: Thomas
- Last Name: Pataki
- Company Name: Televis GmbH
- Address 1: Hainburger Straße 33
- City: Wien
- Zip / Postal Code: 1030
- Country: Austria
- Contact:
-
- 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: subfile choices parameter value
Hi Thomas,
What you can do is bind the 'gridfield1' RPG field directly to the 'choices parameter value' variable. This way, the contents of that variable can be used in each SQL statement to load your dropdown/combo box. Since 'script:' properties are evaluated when the display is loaded, this should work exactly the same as the code in your example.
If, however, it's important to be able to do this from JavaScript... then, unfortuntely, the 'row' variable is not available for 'script:' properties at this time. It is only set for javascript events like 'onrowclick', 'onchange', etc. If the RPG solution won't work for some reason, we could potentially add the 'row' variable for 'script:' events in the future. (But, it won't work today.)
Can you simply bind the RPG value? Will that work?
Let me know your thoughts, please.
What you can do is bind the 'gridfield1' RPG field directly to the 'choices parameter value' variable. This way, the contents of that variable can be used in each SQL statement to load your dropdown/combo box. Since 'script:' properties are evaluated when the display is loaded, this should work exactly the same as the code in your example.
If, however, it's important to be able to do this from JavaScript... then, unfortuntely, the 'row' variable is not available for 'script:' properties at this time. It is only set for javascript events like 'onrowclick', 'onchange', etc. If the RPG solution won't work for some reason, we could potentially add the 'row' variable for 'script:' events in the future. (But, it won't work today.)
Can you simply bind the RPG value? Will that work?
Let me know your thoughts, please.
-
- Profound User
- Posts: 24
- Joined: Thu Jul 24, 2014 6:52 am
- First Name: Thomas
- Last Name: Pataki
- Company Name: Televis GmbH
- Address 1: Hainburger Straße 33
- City: Wien
- Zip / Postal Code: 1030
- Country: Austria
- Contact:
Re: subfile choices parameter value
Hi Scott,
For me I have decided to use an extra hidden field. The hiddenfield1 value would be changed by "onfocus" of the gridfield1.
( gridfield1 choices selection criteria: tablefield1 = ? ; gridfield1 choices parameter value: script:get(hiddenfield1) ; )
So i can use the auto complete function of the gridfield1 dependent on the value of gridfield2.
Nevertheless it would be cool if you add the row variable for script events in the future.
For me I have decided to use an extra hidden field. The hiddenfield1 value would be changed by "onfocus" of the gridfield1.
( gridfield1 choices selection criteria: tablefield1 = ? ; gridfield1 choices parameter value: script:get(hiddenfield1) ; )
So i can use the auto complete function of the gridfield1 dependent on the value of gridfield2.
Nevertheless it would be cool if you add the row variable for script events in the future.
Who is online
Users browsing this forum: No registered users and 1 guest