Focal Point
[SOLVED] Understanding amper variables

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

February 24, 2014, 03:40 PM
HCP
[SOLVED] Understanding amper variables
I have an html page with some filter variables at the top and then a tab control with 2 tabs with iframes in each tab. When the user clicks the 'run' button, I call the IbComposer_execute('iframe1'); IbComposer_execute('iframe2'); method to populate the iframes via a .fex file.

The iframe1 .fex file does some database validation based on the entered filters. If the validation fails, the .fex file sets an amper variable message (&Message) and then triggers a button clicked event on the html page to make the tabs invisible so the user can change their filter criteria. This button also should display the message to the user based on the &Message that is set in the .fex file.

Everything is working as desired, but the &Message is not being populated in the html code (it is being set in the .fex file). There is an edit control on the html page for the &Message variable... so what am I doing wrong?

Here is some of the code..

-*----------.fex file---------------------
-*This method validates filter and set &Message if failure
-INCLUDE app/common_validate_filter.fex
-TYPE Message &Message
-RUN
-IF &Message EQ ' ' THEN GOTO ALL_GOOD;

-HTMLFORM BEGIN
<HTML>
<HEAD></HEAD>
<BODY ONLOAD=window.parent.document.getElementById["button2").click[);></BODY>
</HTML>

-HTMLFORM END

-GOTO EOF

-ALL_GOOD;

-*--------.html file ----------------
function button2_onclick(ctrl) {

//Make objects visible/invisible

showElement(false);

buttonChangeEnable('button1', 'Graph');

alert('!IBI.AMP.Message;');



<input_control bindcontrolid="compUid_201" elementtype="7" name="edit4" id="edit4" multiple="0" inbinding="1" top="110" left="690" width="60" height="20" onetimepopulated="1">
				
<link linktype="default" persistentuniqueid="compUid_109">
					
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
						
<data_info checkForDuplicateValues="0" accept="0" sourcetype="typeMaster" datasource="" displayfield="" datafield="" datatype="0" selectedvalue="!IBI.AMP.Message;" addalloption="0" modifiedrequest="1" operation="NONE">
							
< ![CDATA[]]>
							
<static_values>
<static value="!IBI.AMP.Message;" display="!IBI.AMP.Message;" selected="1" noinput="0"></static></static_values></data_info></condition></link></input_control>


<INPUT style="Z-INDEX: 67; POSITION: absolute; WIDTH: 120px; HEIGHT: 19px; TOP: 90px; LEFT: 690px" id=edit4 tabIndex=115 value=!IBI.AMP.Message; defaultselection="1" persistentuniqueid="compUid_201" name="edit4">

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


Webfocus 7.7.2
Windows, HTML, PDF, and Excel
February 24, 2014, 04:08 PM
j.gross
Try enclosing !IBI.AMP.Message; in quotes, in the INPUT line's value= clause.
February 25, 2014, 08:24 AM
HCP
Thanks, but adding quotes didn't work..


Webfocus 7.7.2
Windows, HTML, PDF, and Excel
February 25, 2014, 09:59 AM
Francis Mariani
As far as I can tell, that !IBI.AMP.Message; is static and is added to the html page once, upon initial load.

Your fex common_validate_filter.fex should not create an amper variable but instead generate a one line report that contains the text of the message. The target of the fex should be an iframe somewhere on the html page.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 25, 2014, 01:27 PM
HCP
Thanks for the info... I was headed in the direction you suggested (generate a one line report) but here is what I did instead.

I created a hidden text field and then added this to the html code to trigger the clicked button.

-HTMLFORM BEGIN
<HTML>
<HEAD></HEAD>
<script>
  parent.document.getElementById("edit4").value = "&Message";
</script>
<BODY ONLOAD=window.parent.document.getElementById("button2").click();></BODY>
</HTML>
-HTMLFORM END


I then modified the button2 clicked code to display the value from the hidden text field.

Works great! Thanks for everyone's help... another great learning opportunity!


Webfocus 7.7.2
Windows, HTML, PDF, and Excel