Focal Point
[SOLVED] Hide listbox on html page on load

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

November 06, 2009, 10:16 AM
Siph7
[SOLVED] Hide listbox on html page on load
Hello, I am trying to hide by default a listbox that is populated with the CAR file. Althought the code was working in 765, we have upgraded to 769, seems the listbox always appear on load now. The radio button seems to be able to hide the listbox and show the listbox properly.

Here's an example of my code using the CAR file.

  
<HTML>
<HEAD>
<META id=mycharsetmeta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<META id=Generation content="Gen 3.0">
<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>
<TITLE>HtmlPage</TITLE>
<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>

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

<SCRIPT id=IBI_nlsVars src="/ibi_html/javaassist/nlsvars.js" type=text/javascript></SCRIPT>

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

<SCRIPT id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);
</SCRIPT>

<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
function OnInitialUpdate(){
 document.getElementsById("CARLIST").style.visibility='hidden';
}
 
//Begin function RADIO_onclick
function RADIO_onclick(ctrl) {
    if(RADIO_0.checked==true) {
    document.getElementById("CARLIST").style.visibility='visible';
 }
 
    if(RADIO_1.checked==true) {
    document.getElementById("CARLIST").style.visibility='hidden';
 }
}
//End function RADIO_onclick
</SCRIPT>

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true" nextelementuniquenumber="20">
<SELECT id=CARLIST style="Z-INDEX: 1; LEFT: 278px; VISIBILITY: hidden; WIDTH: 204px; POSITION: absolute; TOP: 165px; HEIGHT: 340px" tabIndex=1 size=3 name=CARLIST persistentuniqueid="compUid_1"></SELECT> 
<SPAN language=javascript id=RADIO title=RADIO contentEditable=false style="Z-INDEX: 2; LEFT: 332px; WIDTH: 82px; POSITION: absolute; TOP: 74px; HEIGHT: 69px" onclick=RADIO_onclick(this) tabIndex=2 persistentuniqueid="compUid_4" name="radio1" elementtype="12" columns="1" groupChildren="1">
<TABLE contentEditable=false style="WIDTH: 100%; HEIGHT: 100%" cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD>
<INPUT id=RADIO_0 tabIndex=2 type=radio value=Show name=radio1 displaytext="Show"> 
<LABEL id=radio1_LABEL_0 style="CURSOR: default" for=radio1_0>Show</LABEL></TD></TR>
<TR>
<TD>
<INPUT id=RADIO_1 tabIndex=2 type=radio CHECKED value=Hide name=radio1 displaytext="Hide"> 
<LABEL id=radio1_LABEL_1 style="CURSOR: default" for=radio1_1>Hide</LABEL></TD></TR></TBODY></TABLE></SPAN>
<INPUT id=layoutinfo style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden persistentuniqueid="compUid_19"> 
<INPUT id=ibiapp_app style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=mememe name=ibiapp_app persistentuniqueid="compUid_20" name="ibiapp_app"> 
<xml id=focus_xmlelement>
<script>
	
<rootxmlnode top="20" left="719" width="150" height="130">
		
<variables></variables>
		
<input_controls>
			
<input_control bindcontrolid="compUid_1" inbinding="1" top="165" left="278" width="60" height="20" elementtype="9" name="CARLIST" id="CARLIST" multiple="0" unresolved="0" onetimepopulated="0">
				
<link linktype="default">
					
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
						
<data_info datatype="1" sourcetype="typeMaster" datasource="CAR.mas" displayfield="CAR.CARREC.MODEL" datafield="CAR.CARREC.MODEL" ibiapp_app="mememe" ibic_server="EDASERVE" addalloption="1" dynalldisplayvalue="ALL" sortorder="0" selectedvalue="FOC_NONE" ibiformat="A24" dfformat="A24" modifiedrequest="0">
							
<![CDATA[TABLE FILE CAR
SUM FST.CAR.CARREC.MODEL
 BY CAR.CARREC.MODEL
-*insert_filters_here
ON TABLE PCHOLD FORMAT XML
END
]]></data_info></condition></link></input_control>
			
<input_control bindcontrolid="compUid_4" inbinding="1" top="40" left="273" width="60" height="20" elementtype="12" name="radio1" id="RADIO" multiple="0" textvarname="_TEXT" onetimepopulated="1">
				
<link linktype="default">
					
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
						
<data_info modifiedrequest="1">
							
<static_values>
								
<static value="Show" display="Show" selected="0"></static>
								
<static value="Hide" display="Hide" selected="1"></static></static_values></data_info></condition></link></input_control>
			
<input_control bindcontrolid="compUid_19" inbinding="1" top="0" left="0" width="60" height="20" elementtype="26" name="layoutinfo" id="layoutinfo" multiple="0" onetimepopulated="1">
<link linktype="default">
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
<data_info accept="0">
<static_values>
<static value="" display="" selected="0"></static></static_values></data_info></condition></link></input_control>
<input_control bindcontrolid="compUid_20" inbinding="1" top="0" left="0" width="60" height="20" elementtype="26" name="ibiapp_app" id="ibiapp_app" multiple="0" onetimepopulated="1">
<link linktype="default">
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
<data_info accept="0">
<static_values>
<static value="mememe" display="" selected="0"></static></static_values></data_info></condition></link></input_control></input_controls>
		
<other_bound_objects></other_bound_objects>
		
<requests></requests></rootxmlnode></script>
</xml></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
doBeforeLoad();
</SCRIPT>
</HTML>


You can see that by default, the visibility of the listbox is set to hidden and also in the JS, we have put a command to hide the listbox. What is in 769 that changed since 765?

Thanks,

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


WebFOCUS 769
Windows 2003 SP2
Tomcat app server
Excel, HTML, PDF
November 06, 2009, 01:34 PM
mrguru
OnInitialUpdate() is not firing because it is spelled wrong, it should be onInitialUpdate(). The 'O' is lowercase.


WF 8.2.01M
8.2.01M Reporting Server
Windows 2012 Srvr R2
PDF,Excel, HTML
Graphs - a lot of graphs
November 06, 2009, 01:57 PM
Siph7
Thanks but even with the onInitialUpdate() spelled with the 'O' in lowercase, it doesn't change anything.


WebFOCUS 769
Windows 2003 SP2
Tomcat app server
Excel, HTML, PDF
November 06, 2009, 02:35 PM
Tom Flynn
Works perfectly fine for me.

767 DS
769 RS


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 06, 2009, 02:44 PM
Siph7
Thanks guys, I've found the problem. It was due to the 'O' that had to be lowercase but also, the following line:

document.getElementsById("CARLIST").style.visibility='hidden';

should be:

document.getElementById("CARLIST").style.visibility='hidden';

There is not 's' in getElementById. Double typo error.

Why is it always when you ask for help that you start to really see the problem?

I feel so ridiculous... thank you so much.


WebFOCUS 769
Windows 2003 SP2
Tomcat app server
Excel, HTML, PDF
November 06, 2009, 02:51 PM
Tom Flynn
S7,

Don't feel ridiculous! You just helped me with a process where I wanted to do the same thing. I had already removed the "s" in
  
document.getElementsById("CARLIST").style.visibility='hidden';

AND, I forgot to mention that...

I was playing around with the ibirls3 to 2 to blank...

THANKS!!!

Good One


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 07, 2009, 05:11 PM
Doug
Nice Thread
Thanks... I needed this a while ago and abandoned it... So, thanks for bringing it up...