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
indicator (*inxx) value . onload
-
- Profound User
- Posts: 39
- Joined: Mon Aug 21, 2017 11:48 am
- First Name: Jose
- Last Name: hernandez Guerra
- Company Name: CM de gestion y servicios S.L.
- Phone: 638489712
- Address 1: CL Jose Luis de Cassos 50
- City: Sevilla
- State / Province: Outside Canada/USA
- Zip / Postal Code: 41005
- Country: Spain
- 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: indicator (*inxx) value . onload
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.
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.
-
- Profound User
- Posts: 39
- Joined: Mon Aug 21, 2017 11:48 am
- First Name: Jose
- Last Name: hernandez Guerra
- Company Name: CM de gestion y servicios S.L.
- Phone: 638489712
- Address 1: CL Jose Luis de Cassos 50
- City: Sevilla
- State / Province: Outside Canada/USA
- Zip / Postal Code: 41005
- Country: Spain
- Contact:
Re: indicator (*inxx) value . onload
Thank you very much, that's what we've done
Who is online
Users browsing this forum: No registered users and 3 guests