Focal Point
Passing parameters from 2 different HTML's

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

November 27, 2007, 05:20 AM
Moju
Passing parameters from 2 different HTML's
There are currently 3 files, in that 2 HTML & 1 Fex file.

1. Welcom Page
2. Report Main
3. Report.fex


By default "Welcome Page" will be displayed in which report is viewed in a frame.
From the First page( Welcome Page) if user wants any of the columns(Show/Hide, Sort etc), he will navigate to the second HTML page ( Report Main).
Whatever columns he is selecting/deselecting, accordingly the report is getting updated. This functionality has been implemented.

Now what we need to achieve is...

1. From the First page(Welcome Page), if the user selects any of the filters provided in the ListBox , after passing the required parameters from the second page then report is not getting updated accordingly but the report is applying filters on the colums where we have set some default column names. We have to apply the filter conditions based on the parameters which we have received from Second HTML.
2. After user navigates from the Second page ( Report Main) to the first page (Welcome Page), & if he wants to make any other changes, that is if he wants to go
back to the second page(Report Main) from the first page, then he has to view all the values that he had selected previously. Probably we need to create a
session for this.

The code which we have used in FEX is as follows...


-DEFAULT &SORT1 = 'DEPARTMENT',
-DEFAULT &sortcol1 = 'DEPARTMENT',
-DEFAULT &sortcol2 = '',
-DEFAULT &sortcol3 = '',
-DEFAULT &sortcol4 = '',
-DEFAULT &sortcol5 = '',
-DEFAULT &outcol1 = 'FIRST_NAME';
-DEFAULT &outcol2 = 'LAST_NAME';
-DEFAULT &outcol3 = '';
-DEFAULT &outcol4 = '';
-DEFAULT &outcol5 = '';
-SET &SORT1 = IF &sortcol1 NE '' THEN 'BY &sortcol1.EVAL ' ELSE '';
-SET &SORT2 = IF &sortcol2 NE '' THEN 'BY &sortcol2.EVAL ' ELSE '';
-SET &SORT3 = IF &sortcol3 NE '' THEN 'BY &sortcol3.EVAL ' ELSE '';
-SET &SORT4 = IF &sortcol4 NE '' THEN 'BY &sortcol4.EVAL ' ELSE '';
-SET &SORT5 = IF &sortcol5 NE '' THEN 'BY &sortcol5.EVAL ' ELSE '';
-RUN
TABLE FILE EMPLOYEE
PRINT
DEPARTMENT
&outcol1
&outcol2
&outcol3
&outcol4
&outcol5
&SORT1
&SORT2
&SORT3
&SORT4
&SORT5
HEADING
"Employee Details "
WHERE DEPARTMENT CONTAINS &DEPARTMENT.(OR(FIND DEPARTMENT IN EMPLOYEE)).DEPARTMENT.;

Kindly help me out ASAP.

Thanks in advance.
November 27, 2007, 06:55 AM
GamP
Here is an example of how this could be done.
Three files. First is my test.htm, which is the start of the example. This one will load the second file (iframe.htm) in an iframe, which contains the logic to call the fex. The fex only shows the parameters being entered.
The test.htm code:
 
<HTML>
<HEAD>
</HEAD>
<BODY language=javascript style="OVERFLOW: auto">
Variables outside of the iframe:<br>
edit1: <INPUT type=text id=edit1 name=edit1> <br>
edit2: <INPUT type=text id=edit2 name=edit2> 
<br><br>
<iframe name=frame1 width=400 height=220 border=yes src=iframe.htm>
<br><br>
<iframe name=frame2 width=400 height=220 border=yes>
</BODY>
</HTML>
The iframe.htm code:
<HTML>
<HEAD>
<script>
function doCopy() {
var xyzzy = top.document.getElementById('edit1');
document.forms.doit.edit1.value=xyzzy.value;
var xyzzy = top.document.getElementById('edit2');
document.forms.doit.edit2.value=xyzzy.value;
document.forms.doit.submit();
}
</script>
</HEAD>
<BODY language=javascript style="OVERFLOW: auto">
<form name=doit action=/ibi_apps/WFServlet method=post target=frame2>
<INPUT type=hidden name=edit1> 
<INPUT type=hidden name=edit2> 
Variables inside the iframe<br>
edit3: <INPUT type=text id=edit3 name=edit3><br> 
edit4: <INPUT type=text id=edit4 name=edit4> 
<br><br>
<INPUT type=hidden name=IBIAPP_app value="test baseapp">
<input type=button value="Show me" onclick=doCopy();>
<input type=hidden name=IBIF_ex value=show_me>
</form>
</BODY>
</HTML>
And the show_me.fex code:
-TYPE &|edit1 = &edit1
-TYPE &|edit2 = &edit2
-TYPE &|edit3 = &edit3
-TYPE &|edit4 = &edit4

Hope this helps....


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 27, 2007, 09:33 AM
Moju
GamP,
Thanks for your help. I tried to deploy your code but I'am unable to extract the values from the frame.
And also functionality which I'am looking for is not getting implemented.

Whatever parameters you are going to pass from the Second HTML, there should be some thing that holds these values so that I can apply Filter condition (Filter Paramenter from the First page) on top of it.


Thanks in advance.
November 28, 2007, 05:19 PM
StuBouyer
Moju,

From you description it looks like you are going to have to add some hidden input boxes on both HTML pages and add JavaScript code to check if these values are being passed when the page loads and populate the hidden input. This can be done solely on the client side with Javascript or done on the server side with asp or jsp pages. A google search on "Passing parameters between html pages" will give you a bucket-load of examples of how to do this.

If you can post the HTML (does this forum allow attachments?) for the 2 pages we may be able to help you better.

Also during debugging of HTML forms I find it easier to use method='get' so that I can see what is being passed in the URL. After things work I change it back to method='post'

Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)