Page 1 of 1

subfile choices parameter value

Posted: Wed Oct 21, 2015 5:08 am
by tpataki
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

Re: subfile choices parameter value

Posted: Wed Oct 21, 2015 10:42 am
by Scott Klement
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.

Re: subfile choices parameter value

Posted: Wed Oct 21, 2015 4:40 pm
by tpataki
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.