Page 1 of 1
SflNxtChg
Posted: Fri Apr 04, 2014 11:08 am
by mpilo0
Hello,
We use the SflNxtChg quite a bit in our programs, however the Indicator that I set on the property of the grid never seems to get turned on. I want to be able to turn it on using JS so that i can use the ReadC RPG Code like i normally would to read the subfile. Basically i want the JS code to trigger the ReadC in my program for that line.
Thanks
Re: SflNxtChg
Posted: Fri Apr 04, 2014 11:58 am
by Alex
Profound UI has a "subfile next changed" property on the grid widget that is similar to the SFLNXTCHG DDS keyword. However, with “subfile next changed”/SFLNXTCHG, the user still has to initiate the record change.
If you’re looking to trigger a change using JavaScript code, I would simply recommend using the changeElementValue API (
http://www.profoundlogic.com/docs/displ ... +value+%29) to set the value of an input field to its current value, which marks the record as changed. For example:
Code: Select all
changeElementValue("input_field_id." + row, get("input_field_id." + row));
Re: SflNxtChg
Posted: Mon Apr 07, 2014 7:54 am
by mpilo0
I tried what you suggested, however it does not trigger the ReadC instruction in my program. All that my JS does, is set the value of a row column and it does not trigger the readC after my PUI.Click().
Re: SflNxtChg
Posted: Tue Apr 08, 2014 12:53 am
by Scott Klement
Changing the field with changeElementValue (or pui.set) should trigger READC.
There was a bug in older versions of Profound UI that the 'modified' attribute was being lost if someone sorted the subfile. Is it possible that you are running into that issue? If so, it is fixed in Profound UI 4.8.2 or newer.
The only other possibility I can think of is maybe you are changing an output-only field? It needs to be an input-capable field (like a textbox widget) in order to trigger READC
Re: SflNxtChg
Posted: Tue Apr 08, 2014 10:59 am
by mpilo0
Ohh ok, i was indeed changing an output only field. Thank you for your help.
Re: SflNxtChg
Posted: Tue Apr 08, 2014 1:49 pm
by mpilo0
What is my subfile doesn't have an input field. It has buttons and output fields. I want to simulate a button click in my program when the user clicks on a row. I normally simply use ReadC on my subfile, however even when changing the value of the button it still doesn't work.
Re: SflNxtChg
Posted: Tue Apr 08, 2014 2:27 pm
by Alex
You can always create a hidden field. Use a textbox widget, but then right-click it and select Hide in the Visual Designer.
Re: SflNxtChg
Posted: Tue Apr 08, 2014 2:39 pm
by mpilo0
I had alreay thought of that option, I was just trying to avoir it as this is something that will be standard in many programs. Thank you very much to all of you for your help. We will probably go with the hidden field.