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     [WORKAROUND] Call Execution of Button from Procedure

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[WORKAROUND] Call Execution of Button from Procedure
 Login/Join
 
Gold member
posted
We would like to execute a button on an html page after a procedure has finished executing. I've tried searching topics for this but haven't been able to successfully implement anything. Essentially we would like to do the following:

Does anyone know what we are doing wrong here?

  
-HTMLFORM BEGIN
<html>
<script>

OnExecute(button1)

</script>
</html>
-HTMLFORM END
-RUN

This message has been edited. Last edited by: Joey Sandoval,




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Expert
posted Hide Post
From looking at this HTML, the JS function "OnExecute" is not defined anywhere and neither is the JS variable "button".

Is this HTML contained in a window that was opened by the original? If so, you can probably do
parent.OnExecute(...)
but where the "button" variable comes from I don't know...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
The frame which runs this procedure is on an html page which contains button1. We would like the button1 click event to be executed at the final end of this procedure.




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Expert
posted Hide Post
Is this what you want: (exec fex1) -> (display an html form with another "run" button" in it after fex1 is complete to exec fex2)?
If so, that's easy enough. If not, please elaborate. Cool
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Guru
posted Hide Post
This might help;

 
TABLE FILE CAR
PRINT 
     CAR.CARREC.MODEL
BY  LOWEST CAR.COMP.CAR

ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
-HTMLFORM samp_form.htm

 


HTMLFORM code(from the GUI of course):
 
<HTML>
<HEAD>
<META id=mycharsetmeta content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META id=Generation content="Created in release 7703, Generation 3.0">
<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>

<SCRIPT id=IBI_OptionsScript type=text/javascript>
var cgipath = "cgipath";
var ibirls = "ibirls3";

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_nlsVars type=text/javascript src="/ibi_html/javaassist/nlsvars.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);
addIntlTranslatedJS("composertrans.js");
</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
 
 
//Begin function onInitialUpdate
function onInitialUpdate(){
button1.click();
}
//End function onInitialUpdate
 
//Begin function button1_onclick
function button1_onclick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function button1_onclick
</SCRIPT>

<SCRIPT for=window type=text/javascript eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" thumbnailscale="4" elementtype="21" edaconnectionrequired="true">
<INPUT style="Z-INDEX: 1; POSITION: absolute; WIDTH: 290px; DISPLAY: none; HEIGHT: 160px; TOP: 90px; LEFT: 130px" id=button1 language=javascript tabIndex=1 onclick=button1_onclick(this) value=Button type=button autoExecute="true" requests_list="0" name="button1">    
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=layoutinfo type=hidden>
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibiapp_app value=michelle type=hidden name="ibiapp_app">
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibic_server value=EDASERVE type=hidden isdataserversarea="1" name="ibic_server">
<xml id=focus_xmlelement>
<script type="text/xml">
	
<rootxmlnode focoption="_FOC_NULL">
		
<variables></variables>
		
<input_controls></input_controls>
		
<other_bound_objects></other_bound_objects>
		
<requests nextrequestsid="0">
			
<request requestid="0" sourcetype="typeFex" targettype="window" targetname="_blank" ibif_ex="focal_point_samp2.fex" activereport="0" reportcolumns="" reportrealcolumns="" ibiapp_app="michelle"></request></requests></rootxmlnode></script>
</xml></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
doBeforeLoad();
</SCRIPT>
</HTML>
 


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Gold member
posted Hide Post
We are not trying to load an HTML page from a fex. Our starting point is an html page with a frame and a button. After the frame loads our fex, we , want the fex to execute the button on our HTML page.

This message has been edited. Last edited by: Joey Sandoval,




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Guru
posted Hide Post
All you need to do is add the call for the button click to the onInitialUpdate function, with the button hyperlink created to run the second fex.

Try using just this part;


//Begin function onInitialUpdate
function onInitialUpdate(){
button1.click();
}
//End function onInitialUpdate

//Begin function button1_onclick
function button1_onclick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function button1_onclick


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Gold member
posted Hide Post
We do not want to execute button1 on the initial update. Button1 should only be executed from a fex.

So Is it possible to call button1.click() at the end of a procedure?




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Guru
posted Hide Post
Well, I guess if you want this to appear to magically happen after the first fex loads you could set a delay after the first fex loads and then do the button click.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Gold member
posted Hide Post
One of our developers came up with a workaround for this issue:

1. The procedure is executed in a drilldown with the target as an iframe:

   TYPE=DATA, COLUMN=N8, TARGET='iframe2',
FOCEXEC=app/facility_passmetricid(
METRIC_CLICKED=N9 ), $ 


2. The following onload call is added in the html to the iframe.
 
<IFRAME style="Z-INDEX: 1136; POSITION: absolute; WIDTH: 134px; DISPLAY: none; HEIGHT: 136px; VISIBILITY: hidden; TOP: 80px" id=iframe2 tabIndex=531  [B]onload=iframe2_onload(this)[/B]  WIDTHOLD="134" HEIGHTOLD="136" autoExecute="False" name="iframe2"></IFRAME>
 


3: The following javascript function is added to execute the button to refresh our graph.

   function iframe2_onload(ctrl) {
OnExecute(button1)
}




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Virtuoso
posted Hide Post
In the focexec that runs to fill your iframe, you can save your FOCUS result as a hold file and then bang it into an html wrapper at the end that kicks off whatever javascript you like. Something like this:

TABLE FILE CAR
.
.
.
ON TABLE HOLD AS RESULT_X FORMAT HTMTABLE
END

-HTMLFORM BEGIN
<html>
<body onload="javascript:executeParentButtonClick();">
!ibi.fil.RESULT_X;
</body>
</html
-HTMLFORM END


The reference to !ibi.fil.RESULT_X drops the hold file into that location in the html code. Your focexec will run, your result will be embedded into the iframe's html source, and the onload trigger of the iframe will execute. The function called by the onload trigger can do whatever you want it to and has access to the parent's javascript functions.

Bang files are magical for filling drop-down boxes, multi-selects, etc. They're also good for pre-processing three or four report tables and dropping them sequentially one after another in a formalized output (i.e., tucked into a html table with its appropriate borders and widths.)

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report 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     [WORKAROUND] Call Execution of Button from Procedure

Copyright © 1996-2020 Information Builders