As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
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…
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
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007