Page 1 of 2

Button indicator does not turn on consistently

Posted: Wed May 02, 2012 11:20 am
by leomoore
This will be one of those things the solution which will be so simple, I will roll my eyes and think what a cretin I am.

I have a button labelled "Add". When I click it, it does not turn on the indicator except under mysterious circumstances I cannot discern. In debug, the program resumes control as soon as I click the button, but the indicator associated with the button is still '*OFF' most every time. The field containing the new data is cleared, but since the indicator is not *ON the record is not added. It behaves as if enter was pressed. I have spent roughly six hours in debug and cannot understand. There is no code in the program to change the status of the indicator either *ON or *OFF. The program is not a large, complex program and there are only two fields to update. One is a drop down box and one is a free form text of up to 75 characters. That is all there is.[

If you have any ideas, I could use some new ones.

Re: Button indicator does not turn on consistently

Posted: Wed May 02, 2012 11:38 am
by Brian
Hmmm. Your indicator is bound to the "response" property, right?

Any js on the button's "Events"?

Re: Button indicator does not turn on consistently

Posted: Wed May 02, 2012 1:04 pm
by leomoore
The response indicator is bound to a field.

No javascript.

Re: Button indicator does not turn on consistently

Posted: Wed May 02, 2012 1:21 pm
by Brian
That is very strange. I would suggest reporting it to support via email.

Re: Button indicator does not turn on consistently

Posted: Mon May 07, 2012 2:55 pm
by leomoore
I have a little more to add to the scenario. This is a second program that is having the same problem. I am using ProfoundUI's built-in validation. for two fields as well as using a custom button that is labelled "SAVE" linked to an indicator named Save. When the program executes first time through, the three indicators linked to these two fields and the Save button show values of ' '.

I added two lines of code to set the two error indicators to *OFF. I expected that if I displayed the values of the two indicators, they would have values of '0'; however, both showed values of ' '. This time through, I clicked Save and the associated indicator changed to '1' unlike the first iteration when it remained ' '. I manually changed the value of the error indicator to '0' just to test the file update. After the update to the file is complete, I included a line to set the Save indicator to *OFF. This time after it executed, the indicator had a value of '0'. I don't know if these are related. My next idea is to initialise the indicators to '0' at program initialisation since setting them *OFF is not working.

Re: Button indicator does not turn on consistently

Posted: Mon May 07, 2012 4:08 pm
by David
As Brian recommended, the quickest solution is probably to email a copy of your DDS source member to technical support.

We could then have a look.

FYI, the behavior your'e reporting with blank vs. '0' for indicators is normal. If you used named "indicators" in the display files, they are not "really" indicators at all, because you can't have named indicators in a display file.

These are created as 1A fields which RPG initializes to blank, as with all other character fields.

They happen to just work nicely as indicators because you can move *On and *Off into them and also check against those values.

When PUI is using one of these fields as an indicator, it takes '1' (*On) to mean on, and anything else (including blank) to mean off.

Re: Button indicator does not turn on consistently

Posted: Mon May 07, 2012 4:16 pm
by leomoore
Ok. I will send the DDS. My initial post on this subject still occurs. When the button is clicked it is populated with a value of '0' instead of '1'.

Re: Button indicator does not turn on consistently

Posted: Tue May 08, 2012 2:58 pm
by leomoore
I believe I have found a work-around. In my routine to build the screen data, I used a WRITE of the format followed by the EXFMT. The button seems to work perfectly, now. The overhead of additional write statements is not noticeable enough for the human to notice. There is no subfile.

I have attached the DDS for the screen and the code for the RPG ILE program. I added the RPG code, "WRITE VSTRCENRXA", in two places to make the SAVE button indicator work the way I expected. Without them, the indicator will have a value of '0' after the first click. I added the *INZSR to initialize all the indicators to '0', but until I added the two WRITE statements it did not work.

Re: Button indicator does not turn on consistently

Posted: Tue May 08, 2012 3:03 pm
by David
Glad it's working for you, but you really shouldn't have to do that. I would still recommend emailing the DDS to technical support -- I'm sure we could spot any trouble very quickly and save you a lot of headaches down the road.

Re: Button indicator does not turn on consistently

Posted: Tue May 08, 2012 3:42 pm
by leomoore
I attached the code to my previous post. If I still need to e-mail, is there a generic technical support address to use or do I simply choose one of the guys on tech support with whom I have corresponded in the past?