Page 1 of 1

indicator (*inxx) value . onload

Posted: Sun Aug 05, 2018 1:14 pm
by Jose Manuel
Hello everyone,
How can I get the value of an indicator (* INXX) in an onload event without having to use hidden fields ??

Something similar to this: var value = getElementValue ("* inxx");

Thank you

Re: indicator (*inxx) value . onload

Posted: Tue Aug 07, 2018 1:56 pm
by Scott Klement
Hi Jose,

These variables don't exist in the web browser, so you cannot get them. They exist in the RPG/DDS (or Node.js or whatever you're using) that is running on the server. But, they do not exist at all in the web browser.

When you bind a field to a property in a widget, the field's value COPIED from the server to the widget (and possibly reformatted, depending on your binding settings). So, if it is bound to a property (and only if it is bound to a property) you could get the variable's value by retrieving that property's value. If it is bound to the 'value' property, then you can get it with getElementValue() or pui.get() as you alluded to.

That's why we usually recommend using a hidden textbox... because this makes things easy. It ensures that the field is bound to a 'value' property, which is the easiest type of property to get, and when bound to something that's hidden, there's no need to reformat it, so you can get the actual value. Also, textbox values are copied back to the field value when the screen is submitted, so you can also use it to send data back to the server-side program.

Re: indicator (*inxx) value . onload

Posted: Wed Aug 08, 2018 3:29 am
by Jose Manuel
Thank you very much, that's what we've done