The following is the best I can come up with. I worked with some very good people from the New York education staff to get this far, so they deserve most of the credit.
Before you start, you must use a HTML FORM for the validation process to work. I have never been able to get this to work without one.
1) After you build the HTML page, you must edit it manually and add the 3rd argument to the following:
var ibiOptions = new Array(cgipath,ibirls, "mntFormValidate");
This is suppose to add all the necessary JS files required for the ibiValidate to work.
2) Add the following method to the window_onload function:
mntFormValidateOnloadFunc();
This will initialize the validate process.
3) Add the 'ibiValidation="1"' attribute and value to the INPUT objects you wish to validate, and ensure the ibiformat attribute is set to the appropriate format.
4) Now this is important: Once the ibiValiate does it's thing, it will never validate the ok'd object for the remainder of the screens history. So, if you may run a form more then once, add the
mntFormValidateOnloadFunc();
function call to the onSubmit event of the form (between the OnExecute and the return false). This will ensure that a potential second, third, etc. execution of the form will re-validate the INPUT object.
Sample Fex:
-* File z_ibiValidate_test.fex
-DEFAULT &COUNTRY = 'FOC_NONE'
-DEFAULT &SALES = 'FOC_NONE'
TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
SALES
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE COUNTRY EQ '&COUNTRY';
WHERE TOTAL SALES GE &SALES;
END
Sample HTML:
<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<META id=UTF-8 http-equiv=Content-Type content="text/html; charset=UTF-8">
<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, "mntFormValidate");
</SCRIPT>
<SCRIPT id=IBI_nls src="/ibi_html/javaassist/nls.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>
<TITLE>HtmlPage</TITLE>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
mntFormValidateOnloadFunc();
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="false">
<IFRAME id=iframe1 style="Z-INDEX: 6; LEFT: 225px; WIDTH: 820px; POSITION: absolute; TOP: 15px; HEIGHT: 605px" tabIndex=6 name=iframe1 HEIGHTOLD="605" WIDTHOLD="820" autoExecute="False"></IFRAME>
<FORM id=form2 style="Z-INDEX: 7; LEFT: 10px; WIDTH: 208px; POSITION: absolute; TOP: 10px; HEIGHT: 105px" tabIndex=7 name=form2
onsubmit="OnExecute(this);mntFormValidateOnloadFunc();return false;" method=post requests_list="0"
form_dist_between_desc_and_input="10" form_hor_dist_between_controls="10" vert_dist_between_controls="10"
form_number_of_columns="4" form_number_of_visible_rows="4" form_prompt_location="1" default_slider_type="4" fexlist_list="form2">
<INPUT id=form2Submit style="Z-INDEX: 8; LEFT: 5px; BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/run16.gif); WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; POSITION: absolute; TOP: 78px; HEIGHT: 22px; BACKGROUND-COLOR: lavender" tabIndex=8 type=submit value=" " name=ITEM1>
<INPUT id=form2Reset style="Z-INDEX: 9; LEFT: 48px; BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/reset.gif); WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; POSITION: absolute; TOP: 78px; HEIGHT: 22px; BACKGROUND-COLOR: lavender" tabIndex=9 type=reset value=" " name=reset1>
<FIELDSET id=form2_formbodyid style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; Z-INDEX: 10; LEFT: 5px; PADDING-BOTTOM: 0px; OVERFLOW: auto; WIDTH: 198px; BORDER-TOP-STYLE: none; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; POSITION: absolute; TOP: 5px; HEIGHT: 73px; BORDER-BOTTOM-STYLE: none" tabIndex=10 formbody="1" tempwidth="198" tempheight="73">
<SPAN id=pane1 style="Z-INDEX: 11; LEFT: 0px; WIDTH: 95px; POSITION: absolute; TOP: 0px; HEIGHT: 51px" tabIndex=11 elementtype="32" name="COUNTRY">COUNTRY
<INPUT id=edit1 style="Z-INDEX: 12; LEFT: 0px; WIDTH: 95px; POSITION: absolute; TOP: 29px; HEIGHT: 22px" tabIndex=12 hspace=0 maxLength=10 accept=0 size=10 value=FOC_NONE name=COUNTRY dfformat="A10" ibiformat="A10" displayfield="COUNTRY" datafield="COUNTRY" addalloption="0" operation="NONE" selectedvalue="FOC_NONE" datasource boundtovariable="1" requiredfield="1460386" datatype="0" sourcetype="typeMaster" defaultlocation="29,0,51,95"></SPAN>
<SPAN id=pane2 style="Z-INDEX: 13; LEFT: 105px; WIDTH: 71px; POSITION: absolute; TOP: 0px; HEIGHT: 51px" tabIndex=13 elementtype="32" name="SALES">SALES
<INPUT id=edit2 style="Z-INDEX: 14; LEFT: 0px; WIDTH: 71px; POSITION: absolute; TOP: 29px; HEIGHT: 22px" tabIndex=14 hspace=0
maxLength=10 accept=0 size=6 value=FOC_NONE name=SALES dfformat="I6" ibiformat="I6" displayfield="SALES" datafield="SALES" addalloption="0"
operation="NONE" selectedvalue="FOC_NONE" datasource boundtovariable="1" requiredfield="1460386" datatype="0" sourcetype="typeMaster" defaultlocation="29,0,51,71" ibivalidation="1"></SPAN>
</FIELDSET>
</FORM>
<INPUT id=layoutinfo style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden inputcontrolids="edit1;edit2">
<INPUT id=ibiapp_app style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=baseapp name=ibiapp_app>
<xml id=ibi_requests>
<script>
<requests>
<request requestid="0" sourcetype="typeFex" targettype="iframe" targetname="iframe1" ibif_ex="z_ibivalidate_test.fex"
ibic_server="EDASERVE" activereport="0" reportcolumns="" ibiapp_app="baseapp">
<variables>
<variable parametercreatedinreslay="0" displayfield="COUNTRY" format="" field="COUNTRY" file="car.mas" desc="COUNTRY" datatype="0" operation="" default="FOC_NONE" name="COUNTRY" textvarname="" accept="0" type="default" select="0" min="" max="" controltype="7" create="1"></variable>
<variable parametercreatedinreslay="0" displayfield="SALES" format="" field="SALES" file="car.mas" desc="SALES" datatype="0" operation="" default="FOC_NONE" name="SALES" 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>
doBeforeLoad();
</SCRIPT>
</HTML>
Good Luck
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott