Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]How to address the calling window of a drillmenuitem.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]How to address the calling window of a drillmenuitem.
 Login/Join
 
Guru
posted
To the javascripters out here, I was hoping you can help me out.

I am running off of a private dashboard. In this dashboard, I have an html that has a form where a user chooses some filters, clicks run, and the fex runs to display a report on the iframe below. Pretty standard.

This report on the iframe has a multidrill menu item that opens with TARGET=_blank.

Now, this child fex runs some processing and instead of displaying something, I want it to go ahead and refresh the parent report. I got the idea of just going ahead and use javascript to click the Run button on the form again.

I found this pretty simple on javascript if you have a drillmenuitem with TARGET=_self because I can just do a window.parent.

But, I can't figure out how to address the form from a _blank! I feel like this should be a simple matter, yet I can't figure it out.

Help?

This message has been edited. Last edited by: Anatess,
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Virtuoso
posted Hide Post
window.opener is what you seem to be looking for.


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Member
posted Hide Post
Hi,
may be you should give the names to your windows, like TARGET='my_drill_report', so you could adress it any time in javascript as "window" object. An other idea is to use javascript object "opener".

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


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 1 | Location: Germany | Registered: May 07, 2012Report This Post
Guru
posted Hide Post
I tried opener and that doesn't work either.

Frowner


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Virtuoso
posted Hide Post
I tried reading your mind, but that didn't work either.

Just saying, you're not giving us a whole lot to work with.


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
quote:
Originally posted by Wep5622:
I tried reading your mind, but that didn't work either.

Just saying, you're not giving us a whole lot to work with.


I thought this is pretty standard process everywhere.

But, CAR sample code is always clearer, so here goes:

Here's an HTML that launches the fex (used HTML Composer for fast coding):
<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>

<SCRIPT id=IBI_OptionsScript type=text/javascript>
var rltVersion = "764";
var cgipath = "cgipath";
var ibirls = "ibirls2";

var rltdyncalendar = "rltdyncalendar";
var gmap = "ibigmap";
var olap="olap";
var olappanebase="olappanebase";
var olapdrill="olapdrill";

var ibixmltree="ibixmltree";

var ibiOptions = new Array(cgipath,ibirls);
</SCRIPT>

<SCRIPT id=IBI_nls type=text/javascript src="/ibi_html/javaassist/nls.js"></SCRIPT>

<SCRIPT id=IBI_ibigbl type=text/javascript src="/ibi_html/javaassist/ibi/html/js/ibigbl.js"></SCRIPT>

<SCRIPT id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);</SCRIPT>
<TITLE>HtmlPage</TITLE>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//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
</SCRIPT>

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true">
<IFRAME style="Z-INDEX: 1; POSITION: absolute; WIDTH: 720px; HEIGHT: 300px; OVERFLOW: auto; TOP: 80px; LEFT: 0px" id=report1 title=FP1.fex tabIndex=1 name=report1 executebuttonId="form2Submit" requests_list="0" autoExecute="False" elementtype="2"></IFRAME>
<FORM style="Z-INDEX: 2; POSITION: absolute; WIDTH: 690px; HEIGHT: 80px; TOP: 0px; LEFT: 0px" id=form2 tabIndex=2 onsubmit="OnExecute(this);return false;" method=post name=form2 requests_list="0" fexlist_list="report1" default_slider_type="4" form_prompt_location="1" form_number_of_visible_rows="4" form_number_of_columns="4" vert_dist_between_controls="10" form_hor_dist_between_controls="10" form_dist_between_desc_and_input="10">
<INPUT style="BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/run16.gif); Z-INDEX: 3; POSITION: absolute; BACKGROUND-COLOR: lavender; WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 22px; TOP: 10px; LEFT: 240px" id=form2Submit tabIndex=3 value=" " type=submit name=ITEM1>
<INPUT style="BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/reset.gif); Z-INDEX: 4; POSITION: absolute; BACKGROUND-COLOR: lavender; WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 22px; TOP: 40px; LEFT: 240px" id=form2Reset tabIndex=4 value=" " type=reset name=reset1>
<FIELDSET style="Z-INDEX: 5; POSITION: absolute; BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; BORDER-RIGHT-STYLE: none; PADDING-LEFT: 0px; WIDTH: 205px; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; HEIGHT: 65px; BORDER-LEFT-STYLE: none; OVERFLOW: auto; TOP: 5px; PADDING-TOP: 0px; LEFT: 5px" id=form2_formbodyid tabIndex=5 tempheight="73" tempwidth="104" formbody="1">
<SPAN style="Z-INDEX: 6; POSITION: absolute; WIDTH: 205px; HEIGHT: 51px; TOP: 0px; LEFT: 0px" id=pane1 tabIndex=6 elementtype="32" name="CNTRY">Country
<SELECT style="POSITION: absolute; TOP: 25px; LEFT: 25px" id=edit1 tabIndex=7 size=1 name=CNTRY dfformat="A10" ibiformat="A10" datafield="COUNTRY" displayfield="COUNTRY" height="0" CHECKED="false" indeterminate="false" accept="0" start="fileopen" width="0" loop="1" vspace="0" maxLength="5" hspace="0" readOnly="false" defaultlocation="29,0,51,82" addalloption="0" selectedvalue="FOC_NONE" datasource="car.mas" boundtovariable="1" requiredfield="1505890" datatype="1" sourcetype="typeMaster"></SELECT></SPAN></FIELDSET></FORM>
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=layoutinfo type=hidden inputcontrolids="edit1">
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibiapp_app value="ibisamp baseapp" type=hidden name=ibiapp_app>
<xml id=ibi_requests>
<script>

<requests>

<request requestid="0" targettype="iframe" targetname="report1" sourcetype="typeFex" ibif_ex="FP1.fex" ibic_server="" ibiapp_app="ibisamp baseapp" activereport="0" reportcolumns="">

<variables>

<variable field="CNTRY" file="car.mas" desc="CNTRY" datatype="0" operation="" default="FOC_NONE" name="CNTRY" textvarname="" accept="0" type="default" select="0" min="" max="" controltype="7" create="1"></variable></variables></request></requests></script>
</xml></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
getActiveReportJscript();
setUserInfo();
</SCRIPT>
</HTML>


Here's the report named FP1.fex referenced in the iframe with the drilldown (used single drilldown):
  
-DEFAULT &CNTRY='FOC_NONE'
TABLE FILE CAR
PRINT CAR
BY COUNTRY
WHERE COUNTRY EQ '&CNTRY';
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,
     COLUMN=N1,
     TARGET='_blank',
     FOCEXEC=FP2,
$
END


And finally, here's FP2.fex that doesn't need to display anything. Instead, it modifies the CAR file and I want this change reflected in the report of the parent or opener window by having the submit button clicked again to refresh the report:
-DEFAULT &ECHO=ALL
MODIFY FILE CAR
FREEFORM COUNTRY/A10
FREEFORM CAR/A16
MATCH COUNTRY
ON NOMATCH REJECT
ON MATCH CONTINUE
MATCH CAR
ON MATCH DELETE
ON NOMATCH INCLUDE
DATA
'ITALY', 'LAMBORGHINI',$
END
-RUN
-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
function window_onload() {
    window.opener.document.getElementById("form2Submit").click();
}
</SCRIPT>
</HEAD>
<BODY ONLOAD=window_onload();></BODY>
</HTML>
-HTMLFORM END


So, window.opener here doesn't work and my analysis is, it doesn't work because the drilldown doesn't use window.open to get to the child fex.

So, I'm wondering if I'm just having a brain freeze and it's really simple mistake I'm making or if this is really not a simple thing and I need more scripting to get it to work?

And yes, I haven't had the chance to try kulibin's suggestion of passing the window id and using that to reference back.

Wep, I was hoping you can eyeball this, or try it in your installation and see where I missed something.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Guru
posted Hide Post
I KNEW IT WAS STUPIDLY SIMPLE! GRRRR!!!

FRAMES! I keep on forgetting frames.

window.opener.parent.document.getElementById("form2Submit").click();


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Virtuoso
posted Hide Post
Ah yes, the opener is itself inside a (i)frame, after all. We really just needed more details on how you were attempting to reference the other frame, but as I suspected you stopped at window.opener and that wasn't enough.

Glad you found the solution.


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]How to address the calling window of a drillmenuitem.

Copyright © 1996-2020 Information Builders