Page 1 of 2
Chart Data (Refresh)
Posted: Fri Jan 09, 2015 4:17 pm
by rjiron
I’m working with the following program: there are 2 Chart data and 3 sub files with one record format. See attached
1) Chart - Yearly Expenses
2) Chart – Monthly Expenses
3) Sub File - Voucher Information
4) Sub File – G/L Information
5) Sub File – Work Order Summary
When I click in the Monthly Expenses chart (Specific Month ) I’m displaying the Voucher detail Information,(Voucher Information Sub File) but, I do not want to refresh the Month Chart section, because is already there. My question is, there is an option or attribute in profound that allow me to do that?
Re: Chart Data (Refresh)
Posted: Fri Jan 09, 2015 7:13 pm
by Scott Klement
Your screen looks very nice!
Anyway, I think you are asking if it's possible to redraw one part of the screen without redrawing everything. The answer is yes... it's possible. But, depending on how the program works, this might require some major changes.
Whenever the RPG program does something like an EXFMT or WRITE/READ of a screen, Profound UI needs to redraw everything that's part of that screen.
It's possible to use an 'iframe', which lets you display another web page as part of a larger screen. Doing that, you could potentially redraw what's happening in that iframe without affecting the larger screen.
Another way to change part of the screen without redrawing everything is to use JavaScript. There you can change individual parts without sending control back to RPG. But, if some of the data needs to come from the server, this could get very tricky, you'd need to make AJAX requests to get the server data from your JavaScript code and then update the screen.
Also, if the data is coming from 'database-driven' properties (as opposed to loading it in your RPG program) then you could refresh it by changing some of the database criteria and re-rendering the widget. That would allow that widget to change without re-drawing the rest of the screen.
So there are a few options there, but it's not necessarily easy to do. A lot depends on how your program works when it loads this stuff.
Can you explain why you don't want to redraw the rest of the screen? Is it because of performance?
Re: Chart Data (Refresh)
Posted: Sat Jan 10, 2015 2:08 pm
by rjiron
Thanks for your input Scott.
The reason why I do not want to redraw the Chart section, it’s pure aesthetic, because the Chart bars of the Year/Months expenses, appear and disappear and its does not looks good at all.
As you can see in the screen, there is two big section, Chart section and Sub File section, when the user request a new AFE number, new period, vendor or Jobs, it’s make sense to redraw the chart section and remove the sub file section as well, but if the user request an specific month from the (Month Chart bar section) I just want to display or redraw the sub files section, this is for aesthetic only.
Thank you Scott.
Re: Chart Data (Refresh)
Posted: Mon Jan 12, 2015 10:11 am
by Scott Klement
If you mean the animation that displays when the chart is shown, this can be turned off.
IIRC, you do this by putting animation="0" in your chart options.
Re: Chart Data (Refresh)
Posted: Mon Jan 12, 2015 10:52 am
by rjiron
That’s exactly what I was looking for.
You're great!! Thank you so much Scott.
Re: Chart Data (Refresh)
Posted: Mon Jan 12, 2015 2:55 pm
by rjiron
I thought I understood what you are saying, but for some reason is not working.
What I’m doing is, in the Chart Setting section there is (Chart option) and I’m creating an indicator field with mod off, but is not working, What do you mean with IIRC and animation="0"?
Re: Chart Data (Refresh)
Posted: Mon Jan 12, 2015 4:14 pm
by Scott Klement
IIRC is shorthand for "if I recall correctly". I said that because I wasn't 100% sure, since I was going by memory, and sometimes my memory is wrong. But, now I've looked it up, and indeed, animation="0" is the correct value.
You specify it in the 'chart options' property, like this:
- 1-12-2015 2-12-23 PM.png (13.9 KiB) Viewed 3317 times
Note that this assumes that you are NOT using the 'chart XML' or 'chart JSON' properties. If you are using one of those properties, you should specify this value in your XML or JSON for the chart instead of using 'chart options'.
Re: Chart Data (Refresh)
Posted: Mon Jan 12, 2015 5:39 pm
by rjiron
Thank you much, Scott.
Re: Chart Data (Refresh)
Posted: Fri Nov 20, 2015 2:06 pm
by WinKam
Scott,
I have a somewhat related challenge. I have a screen with a main grid, loaded from RPG and 2 dependent database-driven SQL grids. The 2 sql grids are loaded through java script on the on onrowclick event from the main grid. This works fine except, the entire page reloads as the ExFmt statement runs.
My intention is not to have the main grid reload.
Can you provide some additional guidance on how to get database-driven sql grids to load without using pui.click(). I am using the following on the onrowclick event on the main grid but it's not working
getObj("Grid3").grid.refresh();
getObj("Grid3").grid.render();
Thank you.
Re: Chart Data (Refresh)
Posted: Fri Nov 20, 2015 2:22 pm
by WinKam
Scott
I found to way to accomplish what I want. Here's what worked for me :
Add Java script to the onscroll event:
pui.set("TopRow",row);
where TopRow is the bound value for a hidden textbox object on the screen
Set the following Grid properties for the main grid:
"position at top" = true
Bound "subfile record number" to TopRow.
It was pretty simple after all.