Focal Point
[SOLVED] BIP not refreshing with created HTML form:

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

May 19, 2015, 12:18 PM
CoolGuy
[SOLVED] BIP not refreshing with created HTML form:
Hey all,

I have an HTML form for filters that is set up exactly like it should be:

- 7 dropdowns (dynamically populated by external .fexs (works));
- 1 submit button (should work);

The "Embedded JavaScript/CSS" tab has the following code:

if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}


//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();
}


function form1Submit_onclick(ctrl) {
refreshReports();
}


function refreshReports() {
var name = this.window.name;
parent.BipIframeInterface.setAllAmpersValues(name, IbComposer_getAllAmpersValues());
// parent.BipIframeInterface.setAllAmpersValues(name, IbComposer_getAllAmpersValues(), parent.BipIframeInterface.AMPERS_PAGE_ONLY);
parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF, name);
// parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF, name, null, parent.BipIframeInterface.AMPERS_PAGE_ONLY);
}


All controls also have the fieldnames as params for all reports/graphs to be populated in the portal (should be matching up).

What gives? haha Under the "Tasks & Animations" panel, I have a task with:

trigger type: Click
trigger identifier: form1Submit
requests/actions: Refresh1
target type: Refresh BI Portal
[checked] All pages of portal

What haven't I done? My test report has a WHERE clause for &FISCALYEAR (first dropdown param in filter html form) which should be getting passed from the filter html form after the Js shown above executes. At least that's what I thought should be happening.

My test report code:

TABLE FILE AFSTEMP
SUM 
     AFSTEMP.SEG09.CSALES/D15CM AS 'CY Sales'
     AFSTEMP.SEG09.PSALES/D15CM AS 'PY Sales'
BY  LOWEST AFSTEMP.SEG08.DSNAME AS 'Store Name'
ACROSS LOWEST AFSTEMP.SEG01.FISCALYEAR AS 'Fiscal Year'
WHERE AFSTEMP.SEG01.FISCALYEAR EQ '&FISCALYEAR.(FIND AFSTEMP.SEG01.FISCALYEAR IN AFSTEMP).Fiscal year:.';
ON TABLE SET AUTOFIT ON
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/WFC/Repository/retail_reporting/Hidden_Content/styles/report_styles.sty,
$
TYPE=REPORT,
     CALC-LOCATION=TOP,
$
TYPE=REPORT,
     OBJECT=STATUS-AREA,
     JUSTIFY=LEFT,
     PAGE-LOCATION=BOTTOM,
$
ENDSTYLE
END


Does anyone here know what else I haven't done to get this to work? I place the filter html and the test report in a page within the portal designer, and no dice. I would really appreciate the help, thanks!

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


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
May 19, 2015, 06:34 PM
CoolGuy
Just wanted to give you all an update. I finally got the filters working and being
refreshed within the portal. For
some reason (due to IBI's internal inaccessible HTML not being updated most
likely) you can't copy and paste an
event handler into the Embedded Js/CSS tab. You have to allow the HTMLComposer
to create the handler for
you. Also, I was trying to set up a task for the BIP refresh. The second time
around with creating the filter form,
I ignored that panel altogether. I just inserted the Js allowing the
HTMLComposer to update it where it needed to,
and tried that method and it works. Also, back in DevStudio, the event handler
is written slightly differently than
how it is in AppStudio. A "this" reference is passed into the handler versus an
"event" object like in AppStudio.
Not sure why IBI decided to pass the event object with AppStudio. It added 2
lines of code that the app doesn't
necessarily need. Oh well. Got it working. That's the main thing.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.