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     [CLOSED] form.submit()

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] form.submit()
 Login/Join
 
Guru
posted
HTML Composer is driving me insane.

Can somebody using 7.7.03 Dev Studio please run this code in their installation and see if it works? For some idiotic reason, I can't seem to render the report if I submit the form via script instead of using a type=submit button. The script form submission would just display a blank iframe. It wouldn't even display the "loading" image.

HTML:
<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 jsSubmit_onclick
function jsSubmit_onclick(ctrl) {
   document.getElementById("form1").submit();
}
//End function jsSubmit_onclick
</SCRIPT>

<SCRIPT for=window type=text/javascript eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" nextelementuniquenumber="2" thumbnailscale="4" elementtype="21" edaconnectionrequired="true">
<IFRAME style="Z-INDEX: 1; POSITION: absolute; WIDTH: 600px; HEIGHT: 250px; TOP: 190px; LEFT: 40px" id=report1 title=car.fex tabIndex=1 elementtype="2" HEIGHTOLD="250" WIDTHOLD="600" requests_list="0" autoExecute="false" name="report1"></IFRAME>
<FORM style="Z-INDEX: 2; POSITION: absolute; WIDTH: 600px; HEIGHT: 110px; TOP: 80px; LEFT: 40px" id=form1 onsubmit="OnExecute(this);return false;" method=post requests_list="0" tempheight="110" tempwidth="203" fexlist_list="report1" form_newline_chain="1" default_slider_type="4" form_type="1" 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" name="form1">
<LABEL style="Z-INDEX: 5; POSITION: absolute; WIDTH: 54px; HEIGHT: 19px; TOP: 5px; CURSOR: default; LEFT: 5px" id=label1 tabIndex=4 for=edit1 name="edit1">CNTRY</LABEL> 
<INPUT style="Z-INDEX: 6; POSITION: absolute; OVERFLOW-Y: visible; WIDTH: 166px; HEIGHT: 22px; OVERFLOW: visible; TOP: 34px; LEFT: 5px" id=edit1 tabIndex=5 value=JAPAN hspace=0 defaultlocation="0,0,22,146" boundtovariable="1" requiredfield="1" persistentuniqueid="compUid_2" name="edit1"> 
<INPUT style="Z-INDEX: 3; POSITION: absolute; BACKGROUND-COLOR: lavender; WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 22px; TOP: 83px; LEFT: 5px" id=form1Submit tabIndex=2 value="Run" type=submit name="submit1"> 
<INPUT style="Z-INDEX: 4; POSITION: absolute; BACKGROUND-COLOR: lavender; WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 22px; TOP: 83px; LEFT: 48px" id=form1Reset tabIndex=3 value="Reset" type=reset name="reset1"> 
<INPUT style="Z-INDEX: 7; POSITION: absolute; WIDTH: 110px; HEIGHT: 20px; TOP: 80px; LEFT: 160px" id=jsSubmit language=javascript tabIndex=6 onclick=jsSubmit_onclick(this) value=Submit type=button name="jsSubmit"></FORM>  
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=layoutinfo type=hidden>
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibiapp_app value="ibisamp baseapp" type=hidden name="ibiapp_app">
<xml id=focus_xmlelement>
<script type="text/xml" nextelementuniquenumber="2">
	
<rootxmlnode focoption="_FOC_NULL">
		
<variables>
			
<variable controltype="7" parametercreatedinreslay="0" type="default" desc="CNTRY" name="CNTRY" default="JAPAN" textvarname="" accept="0" select="0" create="1">
				
<link linktype="default" from="compUid_2">
					
<condition default="1" name="Default" whattodowithcontrol="4" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
						
<data_info checkForDuplicateValues="0" displayfield="CNTRY" datafield="CNTRY" datasource="car.mas" datatype="0" selectedvalue="JAPAN" operation="" slider_range_from="" slider_range_to="" previewvalue="JAPAN" sourcetype="typeMaster">
							
<static_values>
								
<static value="JAPAN" display="JAPAN" selected="1" noinput="0"></static></static_values></data_info></condition></link>
				
<requestid id="0"></requestid></variable></variables>
		
<input_controls>
			
<input_control bindcontrolid="compUid_2" elementtype="7" name="edit1" id="edit1" multiple="0" onetimepopulated="1">
				
<link linktype="default">
					
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
						
<data_info checkForDuplicateValues="0" datatype="0" datasource="car.mas" addalloption="0" sourcetype="typeMaster" cacheruntimedata="0" accept="0" operation="NONE">
							
<static_values>
<static value="JAPAN" display="JAPAN" selected="1" noinput="0"></static></static_values></data_info></condition></link></input_control></input_controls>
		
<other_bound_objects></other_bound_objects>
		
<requests nextrequestsid="0">
			
<request requestid="0" targettype="iframe" targetname="report1" sourcetype="typeFex" ibif_ex="car.fex" ibiapp_app="ibisamp baseapp" activereport="0" compoundreport="0" reportcolumns="" reportrealcolumns=""></request></requests></rootxmlnode></script>
</xml></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
doBeforeLoad();
</SCRIPT>
</HTML>  


FEX:
-* File car.fex
-DEFAULT &CNTRY='JAPAN';
TABLE FILE CAR
PRINT CAR
BY COUNTRY
WHERE COUNTRY EQ '&CNTRY';
ON TABLE PCHOLD FORMAT HTML
END
-RUN


I haven't had a chance to change my signature. We're on Webfocus 7.7.04 Server with HotFix 6 and 7.7.03 Dev Studio also with HotFix 6. And I'm using IE8 browser.

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


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Master
posted Hide Post
Anatess,

I've tried it with 7.7.02

Doesn't work either. But I don't think the release version is the problem.

It seams that WF does a bit more than just 'submit.form' when clicking the submit button.

For starters : the submit button gets the value 'Run'. Which it doesn't when just submitting the form...

This does work ( ! ):

Use
document.getElementById("form1Submit").click();

instead of
document.getElementById("form1").submit();


I don't know if that is a solution. If you don't want the 'regular' run button, just hide it ( don't delete it ).

Greets, Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Guru
posted Hide Post
Holy macaroni.

For some reason, I thought it works in 7.6.4... but I can't test it now since I don't have 7.6.4 anymore.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
<FreSte>
posted
A lot of "things" are happening in the background when the form is submitted (like
adding the action of the form + much more), see onsubmit="OnExecute(this);return false;

If you want your code/button to run, just add the target in the FORM-tag like
<FORM target="report1" style="Z-INDEX: 2; POSITION: absolute; .... >


and add the following line within the FORM-tags:
<input type=hidden name="IBIF_ex" value="car">
 
Report This Post
Guru
posted Hide Post
quote:
Originally posted by FreSte:
A lot of "things" are happening in the background when the form is submitted (like
adding the action of the form + much more), see onsubmit="OnExecute(this);return false;

If you want your code/button to run, just add the target in the FORM-tag like
<FORM target="report1" style="Z-INDEX: 2; POSITION: absolute; .... >


and add the following line within the FORM-tags:
<input type=hidden name="IBIF_ex" value="car">


This doesn't quite work as expected. The form submits but then the entire html page gets loaded into the iframe, including the form, instead of just rendering the report.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Member
posted Hide Post
FreSte is correct in pointing out the the form if prepared using JavaScript before submitting by passing the form to the JavaScript OnExecute() function.

Try doing the same in your jsSUmit_onclick function:

//Begin function jsSubmit_onclick
function jsSubmit_onclick(ctrl) {

var form = document.getElementById('form1');
OnExecute(form);
}


WF 7.7.03 on Windows
 
Posts: 2 | Registered: September 19, 2012Report This Post
Master
posted Hide Post
@fred @jamesr

Why so much hassle?

What wrong with just virtually clicking the button as I suggested...?



( hi, Fred )


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
<FreSte>
posted
Not sure what you expect by saying:

quote:
... instead of just rendering the report


If you just want the HTML-table without the complete HTML stuff,
change the output format in your fex into

ON TABLE PCHOLD FORMAT HTMTABLE


(Hi Dave, hope all is well )

This message has been edited. Last edited by: <FreSte>,
 
Report This Post
Guru
posted Hide Post
quote:
Originally posted by FreSte:
Not sure what you expect by saying:

quote:
... instead of just rendering the report


If you just want the HTML-table without the complete HTML stuff,
change the output format in your fex into

ON TABLE PCHOLD FORMAT HTMTABLE


(Hi Dave, hope all is well )


The normal action of the Submit button is that it will Post the form which then causes the fex that the iframe is pointing to to run. This then renders the output of the fex right on that iframe.

When I tried your suggestion, it didn't just run the fex in the iframe. Instead, it rendered the entire HTML - including the form - in the iframe. So now you get two forms - the original form, and then the same form inside the iframe with another iframe created inside the iframe that rendered the output of the fex.

Make sense?


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Guru
posted Hide Post
quote:
Originally posted by Dave:
@fred @jamesr

Why so much hassle?

What wrong with just virtually clicking the button as I suggested...?



( hi, Fred )


This works, Dave.

I changed my solution to do so. It's just a pain in the neck to have to have a hidden submit control. But, I can live with that.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report 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     [CLOSED] form.submit()

Copyright © 1996-2020 Information Builders