Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Javascript parameter
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Javascript parameter
 Login/Join
 
Platinum Member
posted
Hello,
I have an outside application that I'm calling my URL (dashboard). I want to pass in my initials within the URL.

From there I want my html file to read my passed in initials and populate my reports.

I'm having an issue of the fex/html file reading my passed in initials parameter.

my fex file:

 TABLE FILE MDGETMETRICSDASHBOARDGROUPDEV
BY  LOWEST MDGETMETRICSDASHBOARDGROUPDEV.ANSWERSET1.GROUPORDER NOPRINT
BY  LOWEST MDGETMETRICSDASHBOARDGROUPDEV.ANSWERSET1.FLEETID
WHERE ( MDGETMETRICSDASHBOARDGROUPDEV.INPUT.@INITIALS EQ '&X' ) AND ( MDGETMETRICSDASHBOARDGROUPDEV.INPUT.@DEFAULTDASH EQ 'fleet' );
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:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENblue_theme.sty,
$
ENDSTYLE
END 



my embedded javascript code in my html file: --currently i have my initials KJT hard coded but I need to get the passed in initials instead.

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

//document.getElementById('edit1').value = "!IBI.AMP.FOCSECUSER;";
document.getElementById('edit1').value = "KJT";
document.getElementById('button1').click();
document.getElementById('edit1').style.display = "none";
document.getElementById('report1').style.display = "none";
document.getElementById('button1').style.display = "none";
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload

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


my url:

...FleetDashboard?INITIALS=KJT

This message has been edited. Last edited by: FP Mod Chuck,


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Reply With QuoteReport This Post
Silver Member
posted Hide Post
did you try to populate the initial's to a text box in the dashboard/html rather passing it to the fex directly which is inside the html.


WebFOCUS 8
Windows, All Outputs
 
Posts: 42 | Registered: January 23, 2018Reply With QuoteReport This Post
Platinum Member
posted Hide Post
no.

how do I pass the initials from my url call directly to the dashboard?

i tried:
function window_onload(initials)(){
updatedata();
document.getElementsById('edit1').value = initials;  


but that didn't work either.


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Since you're already using an amper-variable in your HTML, logic dictates that your other parameters are available by the same means.

You should be able to read your initials from !IBI.AMP.INITIALS;

Another approach would be to dissect the query parameter from the window.location object. See: https://developer.mozilla.org/.../API/Window/location


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1642 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Guru
posted Hide Post
quote:
 WHERE ( MDGETMETRICSDASHBOARDGROUPDEV.INPUT.@INITIALS EQ '&X' ) AND ( MDGETMETRICSDASHBOARDGROUPDEV.INPUT.@DEFAULTDASH EQ 'fleet' );

my url:

...FleetDashboard?INITIALS=KJT


Your amper var should be the same that is inthe URL:

  
WHERE ( MDGETMETRICSDASHBOARDGROUPDEV.INPUT.@INITIALS EQ '&INITIALS' ) AND ( MDGETMETRICSDASHBOARDGROUPDEV.INPUT.@DEFAULTDASH EQ 'fleet' );


Hallway
WF(Prod):8202M
WF(Test):8202M
OS/Platform:Win 10
Outputs:All
 
Posts: 378 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hello<
The !IBI.AMP.INITIALS didn't work.
Here is what I had for the code:
document.getElementById('edit1').value = "!IBI.AMP.INITIALS;";

I wanted to just put it in the edit box so i could see the value that was getting passed in.
All that would display for me was !IBI.AMP.INITIALS in the text

2) I tried the window.loction.href. However, I'm calling a dashboard URL and the window.location.href is using the location of my html page.

So example the url to my dashboard: 'http://dre/ibi_apps/bip/portal/FleetDashboard?INITIALS=KJT'

But in my html page in the edit box it is displaying the actual location of html file.
http://dre/ibi_apps/run.bip?BI...00000&BIP_rand=76048

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


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I don't suppose using document.location behaves any different?

Judging from the missing amper-variable and that edit box your URL is in, it looks like the portal may be combined into one page server-side. If that's true, then the solution depends on whether IBI decided to pass any information in those URL's on to the resulting portal page.

I'm not familiar with the portal, can't help you there...


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1642 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Javascript parameter

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.