Focal Point
[CLOSED] Pass null value to html

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

August 07, 2014, 11:24 AM
Amber
[CLOSED] Pass null value to html
I am passing parms from a fex to a html page. For the values that are blank, the very first space is taken by a blank in the text field of the html page. You have to highlight the blank and delete, or you have a blank space in the table. Also, if the character limit is 10, and you are keying all 10, it will only let you key 9 until you delete the blank.

I have tried passing FOC_NONE, _FOC_NULL, and MISSING but the actual text displayed. How do I remove the blank space? Thanks!

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 07, 2014, 05:23 PM
Waz
How are you populating the HTML page ?

Is the fex returning it ?

Is it being populated by other methods ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 08, 2014, 08:38 AM
Amber
I am populating the html page by a fex. I am using the html page as a display and input screen. I am them passing the parms back to a fex.


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 08, 2014, 11:52 AM
J
Can we see your code (especially if you can reproduce it with a CAR example)?


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 08, 2014, 12:23 PM
Amber
Sure. Here's an abbreviated version using CAR. I don't see any empty values in that file, so I computed one.

-*newfex.fex
-SET &CAR='JAGUAR';
-SET &MODEL='V12XKE AUTO';
TABLE FILE CAR
PRINT
BODYTYPE
COMPUTE NEWVALUE/A1 MISSING ON=IF SEATS EQ 2 THEN MISSING ELSE '2';
WHERE (CAR EQ '&CAR') AND (MODEL EQ '&MODEL');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &BODYTYPE.A12 &NEWVALUE.A1
-HTMLFORM newhtm.htm


-*newhtm.htm
< !-- Generated by Report Layout Painter -->
< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">




<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>
function window_onload() {
UpdateData();
}


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



Bodytype
Blank Input Field





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

































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




WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 08, 2014, 12:25 PM
Amber
Not sure what happened to my html code:



< !-- Generated by Report Layout Painter -->
< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">




<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>
function window_onload() {
UpdateData();
}

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



Bodytype
Blank Input Field





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


















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




WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 08, 2014, 12:28 PM
Amber
This isn't working. Here are my two html input fields.






WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 08, 2014, 12:29 PM
Amber
value=!IBI.AMP.BODYTYPE;

value=!IBI.AMP.NEWVALUE;


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 08, 2014, 12:33 PM
J
Put the code between
 [CODE] [/ CODE]  
the code button looks like
 </> 

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


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 08, 2014, 12:58 PM
J
Well you could always add this after your read command:
-SET &NEWVALUE = IF &NEWVALUE EQ ' ' THEN '' ELSE &NEWVALUE;
Of course the missing value changes depending on what version you are in...

EDIT: To insure this won't be a problem in future releases I would change your code to look like this:
SET HNODATA = '.';
-*newfex.fex
-SET &CAR='JAGUAR';
-SET &MODEL='V12XKE AUTO';
TABLE FILE CAR
PRINT
BODYTYPE
COMPUTE NEWVALUE/A1 MISSING ON=IF SEATS EQ 2 THEN MISSING ELSE '2';
WHERE (CAR EQ '&CAR') AND (MODEL EQ '&MODEL');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLD1
END
-RUN
-READFILE HOLD1
-SET &NEWVALUE = IF &NEWVALUE EQ '.' THEN '' ELSE &NEWVALUE;
-HTMLFORM newhtm.htm
This HNODATA sets the hold format for NODATA. READFILE is just an added bonus ;D

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


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 08, 2014, 01:12 PM
Amber
I've tried the IF &NEWVALUE EQ ' ' THEN ''. I still get the same result. I thought about initializing the field onload using javascript, but I'm not that familiar with javascript and not sure what the syntax would look like.

My other thought is to up the character count of the html field, and do a TRIM on the fex that is ran when when the input/button is submitted.


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 08, 2014, 01:15 PM
J
Read my most recent post via the forums..is HNODATA available for your release?


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 08, 2014, 01:47 PM
Amber
I was able to use HNODATA, but it gave me the same result on the html page. I'm starting to think this is an affect of the html coding and not the fex. Even if I change the &NEWVALUE to an input parm instead of computing, and don't populate a value in the prompt, it still passes holds a blank space in the html text box.

SET HNODATA =
-SET &CAR='JAGUAR';
-SET &MODEL='V12XKE AUTO';
-SET &NEWVALUE=&INPUT1.Type Newvalue Here.;
TABLE FILE CAR
PRINT
BODYTYPE
WHERE (CAR EQ '&CAR') AND (MODEL EQ '&MODEL');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &BODYTYPE.A12
-HTMLFORM newhtm.htm


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
August 08, 2014, 01:54 PM
J
quote:
Originally posted by Amber:

SET HNODATA =
This will just reset NODATA back to the default value with a space. You must put a value in (I used '.' above) and then test for that value after the read command.

I don't know about the input value, it might be specific to your version. Is your tag updated correctly (WebFOCUS 768)?


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 10, 2014, 05:11 AM
Alan B
Use a value of "" when blank:
-*newfex.fex
-SET &CAR='JAGUAR';
-SET &MODEL='V12XKE AUTO';
TABLE FILE CAR
PRINT
BODYTYPE
COMPUTE NEWVALUE/A1 MISSING ON=IF SEATS EQ 2 THEN MISSING ELSE '2';
WHERE (CAR EQ '&CAR') AND (MODEL EQ '&MODEL');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &BODYTYPE.A12 &NEWVALUE.A1

-SET &BODYTYPE = IF &BODYTYPE EQ ' ' THEN '"""' ELSE &BODYTYPE;

-SET &NEWVALUE= IF &NEWVALUE EQ ' ' THEN '"""' ELSE &NEWVALUE;

-HTMLFORM newhtm.htm


or

-*newfex.fex
-SET &CAR='JAGUAR';
-SET &MODEL='V12XKE AUTO';
TABLE FILE CAR
PRINT
BODYTYPE
COMPUTE NEWVALUE/A2 = IF SEATS EQ 2 THEN '""' ELSE '2';
WHERE (CAR EQ '&CAR') AND (MODEL EQ '&MODEL');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &BODYTYPE.A12 &NEWVALUE.A2

-HTMLFORM newhtm.htm

or

-*newfex.fex
SET HNODATA = ""
-SET &CAR='JAGUAR';
-SET &MODEL='V12XKE AUTO';
TABLE FILE CAR
PRINT
BODYTYPE
COMPUTE NEWVALUE/A2 MISSING ON = IF SEATS EQ 2 THEN MISSING ELSE '2';
WHERE (CAR EQ '&CAR') AND (MODEL EQ '&MODEL');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &BODYTYPE.A12 &NEWVALUE.A2

-HTMLFORM newhtm.htm

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007