I have a record format where I have a bar chart at the top and a grid at the bottom showing all detail data that is summed in the chart. When I click on any bar in the chart (response=RspCostMch) I want to re-position the grid to the vale of the x-axis column clicked. The chart is a custom sql driven chart with a parameter in the custom sql. That parameter is a hidden field (ScrnPlant) on the screen that already has a value when executing the format.
During the onload event of the record format, I push the value of ScrnPlant to the parameter on the chart. This works fine. When I click on a bar on the chart, I have the same code to push the parameter to the chart in the onclick event. Works fine.
What I don't understand is why does the chart re-render before I execute the format again. It re-renders the chart while my program is running the code to figure out what row to position at the top of the grid. Then when the program runs the EXFMT again, it does not perform the onload of the record format and my parameter is empty, thus not correctly rendering my chart the 2nd time. I would like to stop it from rendering the chart twice, but even if it does (or has to), why doesn't it perform the onload to the record format when the EXFMT is performed?
How do I accomplish re-positioning the grid and keep my chart from rendering the 2nd time?!
Thank you!
Wendy
chart refresh
-
- Profound User
- Posts: 37
- Joined: Mon Aug 06, 2018 4:00 pm
- First Name: Wendy
- Last Name: Sauers
- Company Name: Conestoga Wood Specialties
- Phone: 5706589663
- Address 1: 441 West Market St.
- City: Beavertown
- State / Province: Pennsylvania
- Zip / Postal Code: 17812
- Country: United States
- 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: chart refresh
Wendy,
I'm not totally sure I understood your description, but... every time you do EXFMT, it completely erases the record format and re-draws it. so, of course, that means the chart is going to re-render.
This also means the onload event for that format will fire again.
Is that what you're asking?
I'm not totally sure I understood your description, but... every time you do EXFMT, it completely erases the record format and re-draws it. so, of course, that means the chart is going to re-render.
This also means the onload event for that format will fire again.
Is that what you're asking?
-
- Profound User
- Posts: 37
- Joined: Mon Aug 06, 2018 4:00 pm
- First Name: Wendy
- Last Name: Sauers
- Company Name: Conestoga Wood Specialties
- Phone: 5706589663
- Address 1: 441 West Market St.
- City: Beavertown
- State / Province: Pennsylvania
- Zip / Postal Code: 17812
- Country: United States
- Contact:
Re: chart refresh
Your response makes me think there may be a bug and I will submit to support. However, let me ask this... is it correct that the chart would render upon clicking on it just because there is a variable present in the 'chart response' property? It does in fact render correctly when I click on it before it ever gets to my EXFMT in the rpg, and then it renders again (incorrectly because the parameter in the custom sql for the chart is blank) when it encounters the EXFMT.
-
- 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: chart refresh
No, the chart shouldn't re-render when you click on it (unless you're telling it to do so). A lot of them do animation when you click on them, though.
-
- Profound User
- Posts: 37
- Joined: Mon Aug 06, 2018 4:00 pm
- First Name: Wendy
- Last Name: Sauers
- Company Name: Conestoga Wood Specialties
- Phone: 5706589663
- Address 1: 441 West Market St.
- City: Beavertown
- State / Province: Pennsylvania
- Zip / Postal Code: 17812
- Country: United States
- Contact:
Re: chart refresh
Scott,
Your response made me realize I was telling it to re-render.
Here's the next question: How do I get my chart's 'chart response' to pass to a parameter in a 2nd drilled down chart? The 2nd chart is on a different record format. I have the onload event code in my 2nd (drilled down to) chart I show below. ID ScrnPlant has the correct data, but the onload event is not retrieving it with the code below.
Here is my custom sql for the drilled down to chart:
select distinct(mnref), sum(MNTLCOST) FROM MNCSTWRK WHERE mnplnt = ? GROUP BY MNREF ORDER BY SUM(MNTLCOST) DESC
var thisPltVal = get('ScrnPlant'); -------> this is what is not working. get('ScrnPlant') returns a null value.
if (thisPltVal === '')
{
thisPltVal = ' ';
}
applyProperty('CostChart_Chart', 'parameter value', thisPltVal);
applyProperty('CostChart_Chart', 'field type', 'chart');
I'll send in a support ticket if that's my next step.
Thank you so much!
Wendy
Your response made me realize I was telling it to re-render.
Here's the next question: How do I get my chart's 'chart response' to pass to a parameter in a 2nd drilled down chart? The 2nd chart is on a different record format. I have the onload event code in my 2nd (drilled down to) chart I show below. ID ScrnPlant has the correct data, but the onload event is not retrieving it with the code below.
Here is my custom sql for the drilled down to chart:
select distinct(mnref), sum(MNTLCOST) FROM MNCSTWRK WHERE mnplnt = ? GROUP BY MNREF ORDER BY SUM(MNTLCOST) DESC
var thisPltVal = get('ScrnPlant'); -------> this is what is not working. get('ScrnPlant') returns a null value.
if (thisPltVal === '')
{
thisPltVal = ' ';
}
applyProperty('CostChart_Chart', 'parameter value', thisPltVal);
applyProperty('CostChart_Chart', 'field type', 'chart');
I'll send in a support ticket if that's my next step.
Thank you so much!
Wendy
-
- 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: chart refresh
Hi Wendy,
It sounds like the problem is that the get('ScrnPlant') is returning an empty string, is that correct?
So you'll need to determine why that's happening.
1. Make sure that get() is referencing the ScrnPlant widget's "id" property. A common mistake is to try to use the bound field name instead of the id. It must be the id.
2. Make sure that you've spelled ScrnPlant exactly the same in the id property as you did in the get() statement.
3. Make sure you used the same upper/lower case values that you did in the id property. JavaScript is a case-sensitive language, so the upper/lower case must match.
Hope that helps!
It sounds like the problem is that the get('ScrnPlant') is returning an empty string, is that correct?
So you'll need to determine why that's happening.
1. Make sure that get() is referencing the ScrnPlant widget's "id" property. A common mistake is to try to use the bound field name instead of the id. It must be the id.
2. Make sure that you've spelled ScrnPlant exactly the same in the id property as you did in the get() statement.
3. Make sure you used the same upper/lower case values that you did in the id property. JavaScript is a case-sensitive language, so the upper/lower case must match.
Hope that helps!
-
- Profound User
- Posts: 37
- Joined: Mon Aug 06, 2018 4:00 pm
- First Name: Wendy
- Last Name: Sauers
- Company Name: Conestoga Wood Specialties
- Phone: 5706589663
- Address 1: 441 West Market St.
- City: Beavertown
- State / Province: Pennsylvania
- Zip / Postal Code: 17812
- Country: United States
- Contact:
Re: chart refresh
Yes that's correct.
I did some further debugging with a coworker and here's what we've found. The code in the onload event for the 2nd or 'drilled down to' record format works intermittently. See this picture attached, I couldn't get it to paste here. So you will see that the choices parameter value = "P2" but what gets returned in the chart is for a blank value, or the choices parameter value = " ". I have 1 record where the value of a 'space' is legitimate and that is the only record that my chart displays. You will see the custom sql statement with the one parameter in the attachment also.
I'm guessing I should probably put in a support ticket to Profound unless you can see something I'm doing wrong.
Again, thank you so much for all your time and effort to my issues! I truly appreciate it!
Wendy
I did some further debugging with a coworker and here's what we've found. The code in the onload event for the 2nd or 'drilled down to' record format works intermittently. See this picture attached, I couldn't get it to paste here. So you will see that the choices parameter value = "P2" but what gets returned in the chart is for a blank value, or the choices parameter value = " ". I have 1 record where the value of a 'space' is legitimate and that is the only record that my chart displays. You will see the custom sql statement with the one parameter in the attachment also.
I'm guessing I should probably put in a support ticket to Profound unless you can see something I'm doing wrong.
Again, thank you so much for all your time and effort to my issues! I truly appreciate it!
Wendy
- Attachments
-
- PF debug screen.png (140.01 KiB) Viewed 1013 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: chart refresh
Nothing jumps out at me, sorry.
-
- Profound User
- Posts: 37
- Joined: Mon Aug 06, 2018 4:00 pm
- First Name: Wendy
- Last Name: Sauers
- Company Name: Conestoga Wood Specialties
- Phone: 5706589663
- Address 1: 441 West Market St.
- City: Beavertown
- State / Province: Pennsylvania
- Zip / Postal Code: 17812
- Country: United States
- Contact:
Re: chart refresh
Worth a shot! I'll email support. Thanks!
Who is online
Users browsing this forum: No registered users and 0 guests