Focal Point
[CLOSED] Auto Populate a Check Box Based on Previous Selection

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

June 21, 2013, 09:37 AM
Mike B
[CLOSED] Auto Populate a Check Box Based on Previous Selection
I have an HTML page with a single checkbox control. The values are dynamically populated using the car field in the car file. After the user checks the desired boxes, they push a button which runs a fex that writes the checked values to a hold file on the server. The next time the HTML page opens, I want it to read the values of that file and put a check mark in the boxes that have a matching value.

So, if they choose Audi and Maserati, the next time the page opens, those two values will be checked and all the other fields will be unchecked.

I unfortunatelly do not have any java experience. I have been looking for the answer but have yet to find it. Please help.

This message has been edited. Last edited by: <Kathryn Henning>,
June 21, 2013, 10:17 AM
J
Save Selection?


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 21, 2013, 10:54 AM
susannah
the approach you can take is...
the htm file (the launch page) is actually going to be called within a fex.
The fex can read whatever, do whatever you need to do, then pass variables to its own embedded .htm
ok so...
TABLE FILE CAR...
do some things
END
-RUN
.* now create some &vars from the results of your fex bits

-HTMLFORM BEGIN
(paste your launch page in here

-HTMLFORM END

-*...
now, you save this thing as a .fex, not as a .htm anymore.
you use !IBI.FIL.filename; to insert, say, a dropdown list you've created.
you use !IBI.AMP.varname; to insert an amper var you've just created.
these things, the !IBI. (its read as bang ibi file, or bang ibi amp) are wicked cool features and standard way of doing things.
Have a go.
and i see this is your first post, welcome




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 21, 2013, 11:00 AM
Mike B
Thanks Susannah. I will give it a shot. Although this is my first post, I have been working with WebFOCUS for many years. First time it has stumped me.........
June 21, 2013, 11:06 AM
J
Or instead of copying your launch page, you can just use:
 
-HTMLFORM launchpage.htm
 

And still use those IBI.variables there. If you are in the MRE, that launch page would need to be 8 characters or less.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 24, 2013, 08:44 AM
Mike B
I have two questions on this. The first is: I have a table that has captured all of the values that the user selects. How can I read all of these values so it can auto-populate all the checkboxes it is supposed to? Then, how do I get the checkboxes populated.
Below is the code I have thus far where hold_car_test is the table that holds the user selected values:

TABLE FILE HOLD_CAR_TEST
PRINT
CAR
ON TABLE HOLD AS A1 FORMAT ALPHA
END

-RUN
-READ A1 &CAR1.A16.
-RUN


-HTMLFORM BEGIN





<script id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}


<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 id=IBI_nls type=text/javascript src="/ibi_html/javaassist/nls.js">

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

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

<script id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);
addIntlTranslatedJS("composertrans.js");

HtmlPage
<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 button1_onclick
function button1_onclick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function button1_onclick

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


<script for=window type=text/javascript eventname="onload">window.onload = function() { window_onload(); }


Product









<script type="text/xml" nextelementuniquenumber="11">

















































< ![CDATA[TABLE FILE CAR
SUM FST.CAR.COMP.CAR
BY CAR.COMP.CAR
-*insert_filters_here
ON TABLE PCHOLD FORMAT XML
END
]]>








<script id=IBI_loader type=text/javascript>
doBeforeLoad();


-HTMLFORM END