Global Change Indicator

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
rmullis
Experienced User
Posts: 100
Joined: Tue Feb 21, 2012 1:24 pm
First Name: Robert
Last Name: Mullis
Company Name: WRC
State / Province: Georgia
Country: United States
Contact:

Global Change Indicator

Post by rmullis »

I have a screen that has multiple input fields on it. Also on the screen, there is a tab panel with three tabs each with input fields. Is there a way that I can set an indicator on globally when any of the input fields changes with out having to set on the indicator on each field when it changes?
Scott Klement
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: Global Change Indicator

Post by Scott Klement »

Hi Robert,

There is a "changed" indicator that can be set on at the record-format level. Look for it under the screen properties in your record format.

It will turn on an indicator if any input element in the record has been changed.
changed.jpg
changed.jpg (35.79 KiB) Viewed 1285 times
rmullis
Experienced User
Posts: 100
Joined: Tue Feb 21, 2012 1:24 pm
First Name: Robert
Last Name: Mullis
Company Name: WRC
State / Province: Georgia
Country: United States
Contact:

Re: Global Change Indicator

Post by rmullis »

Thanks Scott. I have looked for that before, but I guess I just missed it.
rmullis
Experienced User
Posts: 100
Joined: Tue Feb 21, 2012 1:24 pm
First Name: Robert
Last Name: Mullis
Company Name: WRC
State / Province: Georgia
Country: United States
Contact:

Re: Global Change Indicator

Post by rmullis »

Scott,

I have a secondary question. I have an "Update" button on this screen. Initially, I want this button to be disabled, until a change to an input field is made. I don't want to return control to my program every time the user changes the value of a field. Is there a way to disable/enable a button without returning to your RPG program every time a field changes to set on an indicator controlling the button's disable property?
Scott Klement
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: Global Change Indicator

Post by Scott Klement »

Sure, you could. My thinking is that you'd want to mark your button as "disabled" in the designer. Then, you'd want to put JavaScript code on each of the input fields in your form (maybe during the "onchange" or "onblur" event) that enables the button when a change is made.

Unfortunately, I don't know a way to do this at the screen-level.

But, you could ctrl-click all of the input fields, and then assign the onchange event to all of them at once. Just set the onchange event to something like:

Code: Select all

getObj("btnUpdate").disabled = false;
The code is off the top of my head, I didn't test it, and I may very well have gotten the property name wrong or some dumb mistsake like that... but hopefully you get the idea... when the onchange JavaScript event fires, it enables the button. when the screen is subsequently redisplayed by RPG, it'll go back to being disabled until a new change is made, etc.
rmullis
Experienced User
Posts: 100
Joined: Tue Feb 21, 2012 1:24 pm
First Name: Robert
Last Name: Mullis
Company Name: WRC
State / Province: Georgia
Country: United States
Contact:

Re: Global Change Indicator

Post by rmullis »

Thanks Scott. I will give this a try. I need to get out of the green screen mindset where you define the screen via DDS and everything else is done via the RPG program. Any recommendations on good Javascript for Beginners books?
Scott Klement
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: Global Change Indicator

Post by Scott Klement »

Hi Robert,

Honestly, I don't remember exactly how I learned JavaScript. I asked some colleagues what they thought, and they recommended the free W3Schools web site.

Here's their JavaScript page:
http://w3schools.com/js/default.asp

In my experience, this site is a good place to learn any sort of web-related technology. It's free and has some good getting-started tutorials, plus it provides some pretty good "reference manual" style stuff.
robhathome2
Profound User
Posts: 42
Joined: Mon Jun 27, 2011 9:11 am
First Name: Rob
Last Name: Horton
Company Name: Design Group Plc
Contact:

Re: Global Change Indicator

Post by robhathome2 »

Hi

Can someone advise if I'm being dim please. Using version 4.5.3.

I'm using the global change indicator but it doesn't seem to be detecting changes to grid fields (it is working fine with the "control record" fields.

I don't want to resort to using js or rpg based checks if I can help it.

Any ideas?

Thanks

Rob.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest