Focal Point
[SOLVED]Update portal reports onchange just like onclick

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9867066586

February 27, 2017, 11:43 AM
gerndude
[SOLVED]Update portal reports onchange just like onclick
[SOLVED]In my portal all the portal reports are presently updated using the on click coding in the Embedded JavaScript/CSS in the HTML page which is located in the banner of the portal page. Can the JS code be changed to make all the reports update on a selection change? The existing coding is below. I have tried several things but I cannot get this to work. Is it even possible?

//Begin function window_onload
function window_onload() {
UpdateData();


// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload
function onInitialUpdate(){
//refreshReports();
}
//Begin function form1Submit_onclick
function form1Submit_onclick(ctrl) {
refreshReports();
}
//End function form1Submit_onclick
function refreshReports(){
// this is the name of the iframe
var name = this.window.name;
// call to set the ampers for the current page – use Len’s function instead of the hard-coded string
// you only need to set once per page, per run/edit session, unless they change
parent.BipIframeInterface.setAllAmpersValues(name, IbComposer_getAllAmpersValues());
// call to refresh all but self
// the available values for the first parameter are in portalcanvas/util.js – see below
// the third parameter, not passed here, is an array of frame names
parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF, name);
}

This message has been edited. Last edited by: gerndude,


WebFOCUS 8203 Gen 43
App Studio 8203 Gen 04232018
Hyperstage 8203M Gen 1320
MS Sequel Server 2014
Windows 10
Excel/AHTML/PDF/HTML
Chrome, IE11
February 27, 2017, 01:20 PM
MartinY
You have two choices (at least):

1- Under "Task and Animation" add a task where its Trigger Type is "Selection Changed" then continue adding task's parameter as requested

2- Add _onchanged function to controls that you want to fire the report updates as same as you did for the run
function yourControl_oncchanged(event) {
refreshReports();
}



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
February 27, 2017, 03:14 PM
gerndude
Thanks Martin. But I cannot get your suggestion to work. I am attaching a link below to a video that shows you how this works today with the onclick, just to make sure you know what I am doing. Currently, in the HTML page I do not have a "Task and Animation" process that makes this work. The embedded JS triggers the form1Submit action. Have you actually tried your suggestion and if so could you share the code and any screenshots?

https://www.dropbox.com/s/jbwy...ding%20%235.mp4?dl=0


WebFOCUS 8203 Gen 43
App Studio 8203 Gen 04232018
Hyperstage 8203M Gen 1320
MS Sequel Server 2014
Windows 10
Excel/AHTML/PDF/HTML
Chrome, IE11
March 03, 2017, 03:23 PM
gerndude
(CLOSE) I did not get your suggestion to work, but another person helped me. I added a new task: Trigger Type = Selection Changed, Trigger Identifier = unique identifier(s) of your controls, Requests/Action = Refresh1, Target Type = Refresh BI Portal, All pages of Portal.


WebFOCUS 8203 Gen 43
App Studio 8203 Gen 04232018
Hyperstage 8203M Gen 1320
MS Sequel Server 2014
Windows 10
Excel/AHTML/PDF/HTML
Chrome, IE11
March 03, 2017, 03:30 PM
MartinY
Glad to see that you've found a solution.

Edit (bottom right corner icon : folder with a pen) your first post then add [SOLVED] at the beginning of the post subject


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007