Focal Point
[CLOSED] Reload (resort?) launch page values...

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

January 06, 2010, 04:46 PM
Tomsweb
[CLOSED] Reload (resort?) launch page values...
I have created a (prototype) launch page to adapt to a business solution.
I have a launch page which looks like:
  
<HTML>
<BODY>
<FORM action="/ibi_apps/WFServlet?" method="GET" target="ReportWindow">

<INPUT name="IBIF_ex" type="hidden" value="MULTISEL1">
<SELECT name="Country" size="1">

<OPTION VALUE="ALL">All</OPTION>
<OPTION VALUE="ENGLAND">England</OPTION>
<OPTION VALUE="FRANCE">France</OPTION>
<OPTION VALUE="ITALY">Italy</OPTION>
<OPTION VALUE="JAPAN">Japan</OPTION>
<OPTION VALUE="W GERMANY">Germany</OPTION>
</SELECT>



<INPUT type="submit" name="Submit" value="Submit">
<INPUT type="reset"  name="reset"  value="Reset">
</FORM>
</BODY>
</HTML>


To run a fex where user can select 'ALL' to see a report of cars in
all countries, or select a specific country to appear in a report.

-SET &ECHO=ALL;
-*
-? &
-RUN

TABLE FILE CAR
PRINT
CAR
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY';
END


I am having a problem getting the launch page to reload with the country
I just selected to appear in the 1st position in the country dropdown.
For example, if I chose 'FRANCE' on the initial launch page, I would like
the launch page to reload with this…

<HTML>
<BODY>
<FORM action="/ibi_apps/WFServlet?" method="GET" target="ReportWindow">

<INPUT name="IBIF_ex" type="hidden" value="MULTISEL1">
<SELECT name="Country" size="1">

<OPTION VALUE="FRANCE">France</OPTION>
<OPTION VALUE="ALL">All</OPTION>
<OPTION VALUE="ENGLAND">England</OPTION>
<OPTION VALUE="ITALY">Italy</OPTION>
<OPTION VALUE="JAPAN">Japan</OPTION>
<OPTION VALUE="W GERMANY">Germany</OPTION>
</SELECT>



<INPUT type="submit" name="Submit" value="Submit">
<INPUT type="reset"  name="reset"  value="Reset">
</FORM>
</BODY>
</HTML>


Has anyone done this? Can anyone provide any ideas?

Thanks! Roll Eyes

Tomsweb

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
January 06, 2010, 04:59 PM
Waz
Please enclose your code in
[CODE]  
[/CODE]


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!

January 06, 2010, 06:12 PM
Dan Satchell
Here is one approach that relies on -INCLUDE of a focexec before the beginning of the HTML (-HTMLFORM BEGIN) in your launch page. The focexec would look something like this.

-DEFAULTS &COUNTRY = ' '
-*
DEFINE FILE CAR
 CTRY_OPTION/A60 = IF (COUNTRY EQ '&COUNTRY')
                   THEN ('<option selected value="' | COUNTRY || '">' || COUNTRY || '</option>')
                   ELSE ('<option value="' | COUNTRY || '">' || COUNTRY || '</option>');
END
-*
TABLE FILE CAR
  SUM CTRY_OPTION
   BY COUNTRY NOPRINT
   ON TABLE SAVE AS CTRYHTML
END


The first time you launch your form, &COUNTRY will default to blank and the SELECT will default to 'All' at the top of the list. If the user selects a country, variable &COUNTRY will be populated with that value and subsequent launches of the form will select that country as the default.

The SELECT in your HTML would change to incorporate the SAVE file created by the focexec:

-MRNOEDIT -INCLUDE <focexec name>

-HTMLFORM BEGIN
.
.
<SELECT name="Country" size="1">
 <OPTION VALUE="$">All</OPTION>
 !IBI.FIL.CTRYHTML;
</SELECT>
.
.
-HTMLFORM END


I suggest replacing the VALUE for "All" from "ALL" to "$" so your WHERE clause becomes
WHERE COUNTRY EQ '$';

instead of
WHERE COUNTRY EQ 'ALL';



If you prefer to use a static SELECT statement, then you might try something like this.

-DEFAULTS &COUNTRY = ' '
-DEFAULTS &SEL_ENGLAND = ' ', &SEL_FRANCE = ' ', &SEL_ITALY = ' '
-DEFAULTS &SEL_JAPAN = ' ', &SEL_GERMANY = ' '
-*
-SET &SEL_ENGLAND = IF '&COUNTRY' EQ 'ENGLAND'   THEN 'SELECTED' ELSE ' ';
-SET &SEL_FRANCE  = IF '&COUNTRY' EQ 'FRANCE'    THEN 'SELECTED' ELSE ' ';
-SET &SEL_ITALY   = IF '&COUNTRY' EQ 'ITALY'     THEN 'SELECTED' ELSE ' ';
-SET &SEL_JAPAN   = IF '&COUNTRY' EQ 'JAPAN'     THEN 'SELECTED' ELSE ' ';
-SET &SEL_GERMANY = IF '&COUNTRY' EQ 'W GERMANY' THEN 'SELECTED' ELSE ' ';
-*
-HTMLFORM BEGIN
.
.
<SELECT name="Country" size="1">
<OPTION VALUE="ALL">All</OPTION>
<OPTION &SEL_ENGLAND VALUE="ENGLAND">England</OPTION>
<OPTION &SEL_FRANCE VALUE="FRANCE">France</OPTION>
<OPTION &SEL_ITALY VALUE="ITALY">Italy</OPTION>
<OPTION &SEL_JAPAN VALUE="JAPAN">Japan</OPTION>
<OPTION &SEL_GERMANY VALUE="W GERMANY">Germany</OPTION>
</SELECT>
.
.
-HTMLFORM END



WebFOCUS 7.7.05
January 07, 2010, 12:29 PM
Tomsweb
Thank you Dan, I will try it out!


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36