pressKey in profoundUI
-
- Profound User
- Posts: 35
- Joined: Fri Jul 12, 2013 12:58 pm
- First Name: Dan
- Last Name: Pankowski
- Company Name: Sinclair Services
- Phone: 8015242956
- Address 1: 550 E South Temple
- City: Salt Lake City
- State / Province: Utah
- Zip / Postal Code: 84102
- Country: United States
- Contact:
pressKey in profoundUI
Hi,
We have a proufound rich display that uses the pressKey api. I know it's a genie function, but it was working until we uprgraded to 5.0.8.
Now it says pressKey not defined. We have only upgraded our test system, but the developer has used it in other programs that are in production, so we can't upgrade the production system.
thanks
Dan
We have a proufound rich display that uses the pressKey api. I know it's a genie function, but it was working until we uprgraded to 5.0.8.
Now it says pressKey not defined. We have only upgraded our test system, but the developer has used it in other programs that are in production, so we can't upgrade the production system.
thanks
Dan
-
- 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: pressKey in profoundUI
Hmm.. that's very strange.
Can you tell me which release allowed pressKey() to work in a rich display? And give me an example so I can try it? I've never heard of it working on a Rich Display in any release.
Can you tell me which release allowed pressKey() to work in a rich display? And give me an example so I can try it? I've never heard of it working on a Rich Display in any release.
-
- Profound User
- Posts: 35
- Joined: Fri Jul 12, 2013 12:58 pm
- First Name: Dan
- Last Name: Pankowski
- Company Name: Sinclair Services
- Phone: 8015242956
- Address 1: 550 E South Temple
- City: Salt Lake City
- State / Province: Utah
- Zip / Postal Code: 84102
- Country: United States
- Contact:
Re: pressKey in profoundUI
Yes 5.0.4
I am having him change all of them to pui.click(); I'm not sure why they used pressKey in the first place.
I am having him change all of them to pui.click(); I'm not sure why they used pressKey in the first place.
-
- 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: pressKey in profoundUI
Do you have an example that I can try where pressKey() worked at 5.0.4?
-
- Profound User
- Posts: 35
- Joined: Fri Jul 12, 2013 12:58 pm
- First Name: Dan
- Last Name: Pankowski
- Company Name: Sinclair Services
- Phone: 8015242956
- Address 1: 550 E South Temple
- City: Salt Lake City
- State / Province: Utah
- Zip / Postal Code: 84102
- Country: United States
- Contact:
Re: pressKey in profoundUI
Yes I saved the old source before changing it.
How do you want it?
Thanks
-dan
How do you want it?
Thanks
-dan
-
- 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: pressKey in profoundUI
Hi Dan,
Yes, if you could attach it here, or e-mail it to support@profoundlogic.com, that would be great.
Yes, if you could attach it here, or e-mail it to support@profoundlogic.com, that would be great.
-
- 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: pressKey in profoundUI
An easy way to get it to your PC is to open it in the visual designer, then do 'Save As' and save it as a local file to your PC. Just upload that PC file here... thanks
-
- Profound User
- Posts: 35
- Joined: Fri Jul 12, 2013 12:58 pm
- First Name: Dan
- Last Name: Pankowski
- Company Name: Sinclair Services
- Phone: 8015242956
- Address 1: 550 E South Temple
- City: Salt Lake City
- State / Province: Utah
- Zip / Postal Code: 84102
- Country: United States
- Contact:
Re: pressKey in profoundUI
Here it is.
It's in the element chart3. But it's used a number of other places.
Thanks
Dan
It's in the element chart3. But it's used a number of other places.
Thanks
Dan
- Attachments
-
- AFEInq02D.json
- (65.28 KiB) Downloaded 240 times
-
- 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: pressKey in profoundUI
Hi Dan,
I tried this on three versions of Profound UI, 5.0.4 (your "old" version), 5.0.8 (your "new" version) and our current development sources that will eventually be 5.0.9. It worked the same way on all of them. This isn't a surprise, since the code in the pressKey() API has not changed, but I wanted to be sure. And, indeed, they work exactly the same.
Here's what's happening... when pressKey() is run from a Rich Display, it detects that it's not on a 5250 screen, and just ends. It does nothing, it just ends the API, and nothing happens. I tried it on all versions... it does nothing at all.
Your screens are being submitted because you have a 'chart response' property set. When you see the word 'response' in Profound UI, it's our code-word for "set a variable and submit the screen". And, 'chart response' is no exception! In the example you gave, Chart3 has MEXP02 bound do the chart response property, so it puts the part of the chart you clicked on into MEXP02 variable, and then submits control back to your RPG program. That's why the screen is submitting, it's NOT because of the pressKey() API.
Whomever made your screens must've thought they needed the pressKey() API to submit the screens, so they coded it on the onclick event of the chart. And to them it must've seemed like it was working because the chart was submitting control back to RPG. But, in fact, the pressKey wasn't what was doing that, it was the chart response.
I would NOT change these to use pui.click() -- insteaed, I would just remove the 'onclick' property from the charts, it's not needed. I do not know what pui.click() would do in this case... Unlike pressKey(), pui.click() would not be ignored here, and it would attempt to submit the screen. I haven't tested to see what happens when both pui.click() and chart response are both trying to submit it... probably no reason to figure that out, anyway, since there's really no need to code pui.click().
This leaves one question: Why are you thinking that something changed between 5.0.4 and 5.0.8? Because I can see very clearly that the code is identical, and I tried it on both, and it works the same to me.
Is it possible that you are running the screen differently? The pressKey() routine is only available in Genie, so if you run your Rich Display from a Genie interface, then you should get the behavior I listed above. However, if you ran it outside of Genie (for example, using a 'Rich Display' launcher from Atrium, or the 'Launch' option in the Visual Designer, etc, etc) then you would get a "pressKey is not defined" error or similar from your browser, since these options do not load Genie's code into memory. Could that be what's happening? Maybe you are running it differently on 5.0.8 than you were on 5.0.4?
I tried this on three versions of Profound UI, 5.0.4 (your "old" version), 5.0.8 (your "new" version) and our current development sources that will eventually be 5.0.9. It worked the same way on all of them. This isn't a surprise, since the code in the pressKey() API has not changed, but I wanted to be sure. And, indeed, they work exactly the same.
Here's what's happening... when pressKey() is run from a Rich Display, it detects that it's not on a 5250 screen, and just ends. It does nothing, it just ends the API, and nothing happens. I tried it on all versions... it does nothing at all.
Your screens are being submitted because you have a 'chart response' property set. When you see the word 'response' in Profound UI, it's our code-word for "set a variable and submit the screen". And, 'chart response' is no exception! In the example you gave, Chart3 has MEXP02 bound do the chart response property, so it puts the part of the chart you clicked on into MEXP02 variable, and then submits control back to your RPG program. That's why the screen is submitting, it's NOT because of the pressKey() API.
Whomever made your screens must've thought they needed the pressKey() API to submit the screens, so they coded it on the onclick event of the chart. And to them it must've seemed like it was working because the chart was submitting control back to RPG. But, in fact, the pressKey wasn't what was doing that, it was the chart response.
I would NOT change these to use pui.click() -- insteaed, I would just remove the 'onclick' property from the charts, it's not needed. I do not know what pui.click() would do in this case... Unlike pressKey(), pui.click() would not be ignored here, and it would attempt to submit the screen. I haven't tested to see what happens when both pui.click() and chart response are both trying to submit it... probably no reason to figure that out, anyway, since there's really no need to code pui.click().
This leaves one question: Why are you thinking that something changed between 5.0.4 and 5.0.8? Because I can see very clearly that the code is identical, and I tried it on both, and it works the same to me.
Is it possible that you are running the screen differently? The pressKey() routine is only available in Genie, so if you run your Rich Display from a Genie interface, then you should get the behavior I listed above. However, if you ran it outside of Genie (for example, using a 'Rich Display' launcher from Atrium, or the 'Launch' option in the Visual Designer, etc, etc) then you would get a "pressKey is not defined" error or similar from your browser, since these options do not load Genie's code into memory. Could that be what's happening? Maybe you are running it differently on 5.0.8 than you were on 5.0.4?
-
- Profound User
- Posts: 35
- Joined: Fri Jul 12, 2013 12:58 pm
- First Name: Dan
- Last Name: Pankowski
- Company Name: Sinclair Services
- Phone: 8015242956
- Address 1: 550 E South Temple
- City: Salt Lake City
- State / Province: Utah
- Zip / Postal Code: 84102
- Country: United States
- Contact:
Re: pressKey in profoundUI
Thanks Scott,
Sorry for the late reply, I was out of the office for a few days.
We'll take the onclick event out of the charts.
The application works fine on the development and production boxes that are 5.0.4, but we get the error on the test box that's at 5.0.8. The chart still submits and the program works, we just get that javascript error.
They are submitted the same, a direct link out of Atrium: /profoundui/auth/start?pgm=APQA/CCENTER10C&p1=QA&l1=10
The only difference are the parameters and the box is a physically different machine. But I'll take a closer look.
I'll also look at the application verions and when they were integrated to test and production, but I won't spend a lot of time since it shouldn't be designed this way in the first place.
thanks
-dan
Sorry for the late reply, I was out of the office for a few days.
We'll take the onclick event out of the charts.
The application works fine on the development and production boxes that are 5.0.4, but we get the error on the test box that's at 5.0.8. The chart still submits and the program works, we just get that javascript error.
They are submitted the same, a direct link out of Atrium: /profoundui/auth/start?pgm=APQA/CCENTER10C&p1=QA&l1=10
The only difference are the parameters and the box is a physically different machine. But I'll take a closer look.
I'll also look at the application verions and when they were integrated to test and production, but I won't spend a lot of time since it shouldn't be designed this way in the first place.
thanks
-dan
Who is online
Users browsing this forum: No registered users and 6 guests