How to: |
This section has an example of JavaScript that you can use to pass current selections from the HTML page to the BI Portal and to have the BI Portal refresh all components, except itself.
This action switches you to the Embedded JavaScript section and creates a function called form1Submit_onclick.
//Begin function form1Submit_onclick function form1Submit_onclick(ctrl) { refreshReports(); } //End function form1Submit_onclick
function refreshReports(){ var name = this.window.name; parent.BipIframeInterface.setAllAmpersValues(name, IbComposer_getAllAmpersValues()); parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF , name); }
Note: The third line wraps in this document, but it should appear on one line when you write it in HTML Composer.
The three lines break down as follows:
Line 1:
var name = this.window.name;
This line gets the current window name. This is needed as a parameter in Line 2.
Line 2:
parent.BipIframeInterface.setAllAmpersValues(name,IbComposer_getAllAmpersValues());
This line must be broken down into two pieces.
Piece 1:
IbComposer_getAllAmpersValues())
This function gets the currently selected values from all controls on an HTML Composer page as a single string that you can append to the end of a URL call.
Piece 2:
parent.BipIframeInterface.setAllAmpersValues
This function takes the name of the current window and the string returned by Piece 1 (or any string you provide) and tells the portal to append this string at the end of any request it runs on all pages of the portal. There is an optional third parameter that can be sent to restrict the variables to a specific page. The following is an example of a page specific call.
parent.BipIframeInterface.setAllAmpersValues(name, "&ers…", parent.BipIframeInterface.AMPERS_PAGE_ONLY);
Line 3:
parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF , name);
This function refreshes all frames on the portal that have already been run, except for the frame with the controls. This includes frames not on the currently visible page.
To refresh just the current page:
parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF, name, null, parent.BipIframeInterface.AMPERS_PAGE_ONLY);
In the preceding examples, the first parameter to this function is always:
BipIframeInterface.REFRESH_ALL_BUT_SELF
There are other possibilities, shown in the following table.
Refresh Type | Parameter Value |
---|---|
All Frames | BipIframeInterface.REFRESH_ALL |
Just the current frame | BipIframeInterface.REFRESH_SELF_ONLY |
All except the current frame | BipIframeInterface.REFRESH_ALL_BUT_SELF |
Specific list (array) of frames | BipIframeInterface.REFRESH_ARRAY |
Frames not in the list (array) of frames | BipIframeInterface.REFRESH_ALL_BUT_ARRAY |
function onInitialUpdate(){refreshReports();}
Note: This function provides default values for any reports that might not have them specified. After the form loads the controls, the function is called and the default value from the form is sent to all reports.
The complete Embedded Java Script tab is shown in the following image.
WebFOCUS |