Focal Point Banner


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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Refresh the report
 Login/Join
 
<Umm>
posted
Hi All,

Actually, I have two combo box, In which first combo is having three column names(Country , Region , City), So I just want that When I select country from the first combo it immediatelly refresh the report and display all values of country in second combo....and same it will do for Region and City.

Please help me
 
Report This Post
Expert
posted Hide Post
That you do with javascript arrays, its not a webfocus issue. you can get help with js arrays on a js board, try the coding forum at javascriptkit.com. the report doesn't refresh...just a new selection of parms in the second dropdown list, assuming both parm lists are on the same launch page.
ps. i recall being told that this feature was going to be included in devstu version 7n
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
<JG>
posted
The code below is a dynamic version of what you want to do based on the car file.

If you want static code, run it, and view source to see what you need to do
 
-*
-* SET DEFAULT VALUES for required  amper variables
-*
-DEFAULT &step=' '
-DEFAULT &COUNTRY='$*'
-DEFAULT &CAR='$*'
-DEFAULT &MODEL='$*'
-*
-* Check if your runnging the actual report of generating the dropdowns
-* and branch to the report if needed.
-*
-IF &step EQ 'runreport' GOTO runreport;
-*
SET HOLDLIST=PRINTONLY
SET PAGE=NOPAGE
-*
-* generate the first dropdown list as a standard option tag/value pair
-* save the output in ALPHA format
-*
DEFINE FILE CAR
OPT1/A100='<OPTION>' | COUNTRY || '</OPTION>';
END
TABLE FILE CAR
SUM
    OPT1
BY
     COUNTRY NOPRINT
ON TABLE SAVE AS CLIST1 FORMAT ALPHA
END
-RUN
-*
-* Generate the javascript code required for the 2nd dropdown
-* this is a two stage process. 1st extract the values sorted by the
-* value for the first dropdown and 2nd reformat the output using a define
-* to add the required Javascript syntax.
-* pay special attention to the labels and the subhead. The DF ('---- SELECT ----')
-* is very important for the onchange function used in the HTML
-* IMPORTANT save the output in WP format. This is required to ensure that the subhead and subfoot
-* is saved to the output file
-*
TABLE FILE CAR
PRINT CAR
BY COUNTRY
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
FILEDEF CLIST2 DISK .\CLIST2.FTM
-RUN
DEFINE FILE HOLD1
DQ/A100='"' || COUNTRY || '"';
DF/A100='Select2.options[Select2.options.length] = new Option(' | '''' || '---- SELECT ----' || '''' || ');' ;
OPT2/A100='Select2.options[Select2.options.length] = new Option(' | '''' || CAR || '''' || ');' ;
END
TABLE FILE HOLD1
PRINT OPT2 AS ''
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON COUNTRY SUBHEAD
"if (o == <DQ )"
"{"
"<DF"
ON COUNTRY SUBFOOT
"}"
ON TABLE HOLD AS CLIST2 FORMAT WP
END
-*
-* Generate the javascript code required for the 3rd dropdown
-* this is a two stage process. 1st extract the values sorted by the
-* value for the first dropdown and 2nd reformat the output using a define
-* to add the required Javascript syntax.
-* pay special attention to the labels and the subhead. The DF ('---- SELECT ----')
-* is very important for the onchange function used in the HTML
-* IMPORTANT save the output in WP format. This is required to ensure that the subhead and subfoot
-* is saved to the output file
-*
FILEDEF CLIST3 DISK .\CLIST3.FTM
-RUN
TABLE FILE CAR
PRINT MODEL
BY COUNTRY NOPRINT
BY CAR
ON TABLE HOLD AS HOLD2 FORMAT ALPHA
END
DEFINE FILE HOLD2
DQ/A100='"' || CAR || '"';
DF/A100='Select3.options[Select3.options.length] = new Option(' | '''' || '---- SELECT ----' || '''' || ');' ;
OPT3/A100='Select3.options[Select3.options.length] = new Option(' | '''' || MODEL || '''' || ');' ;
END
TABLEF FILE HOLD2
PRINT OPT3 AS ''
BY CAR NOPRINT
BY MODEL NOPRINT
ON CAR SUBHEAD
"if (o == <DQ )"
"{"
"<DF"
ON CAR SUBFOOT
"}"
ON TABLE SAVE AS CLIST3 FORMAT WP
END
-RUN
-*
-* create your selection menu as a WebFocus HTMLFORM
-*
-*
-runform
-HTMLFORM BEGIN
  <HTML>
  <HEAD>
  <TITLE>Choose Model</TITLE>
-*
-* Script to run the report after the final selection
-*
<script language="JavaScript">
  <!--
function getProds(whereto)
  {
    window.status = 'Working Please Wait';
    form1.step.value = ""+whereto
    document.form1.submit();
  }
  // -->
</script>
-*
-* Script which changes the windows message at the bottom of the Browser
-*
<script language="JavaScript">
    function wStatus()
  {
    window.status = 'Screen Ready';
  }
</script>
-*
-* Script for the 2nd dropdown box which is populated from the second extract at run time
-*
<script language="javascript">
 function Select2Options(o)
  {
  var Select2 = document.form1.Select2;
  Select2.options.length = 0;
  !IBI.FIL.CLIST2;
  }
</script>
-*
-* Script for the 3rd dropdown box which is populated from the second extract at run time
-* this script contains extra code to empty the 3rd dropdown if you change your selection
-* from the first dropdown
-*
<script language="javascript">
 function Select3Options(o)
  {
  var Select3 = document.form1.Select3;
  Select3.options.length = 0;
  if (o == "NULL" )
  {
  Select3.options[Select3.options.length] = new Option(' ');
  }
  !IBI.FIL.CLIST3;
  }
</script>
</HEAD>
<BODY onLoad="wStatus()">
  <FORM  NAME=form1 ACTION="/ibi_apps/WFServlet" METHOD="POST"
  TARGET="_top">
  <INPUT TYPE="hidden" NAME="IBIF_ex" VALUE="javascript_dynamic_dropdowns.fex">
  <INPUT TYPE="hidden" NAME="step" VALUE="STEP_4">
  <P><H4>[i]<font color="6A5ACD">Select Country:</font>[/i]</H4>
-*
-* The 1st dropdown the onchange action runs the 2nd dropdown script and populates the 2nd dropdown box
-* it also runs the 3rd dropdown script and resets the 3rd dropdown box so that it is empty
-*
  <SELECT  WIDTH="300" STYLE="width: 200px" NAME="COUNTRY" 
onchange="Select2Options(document.form1.COUNTRY.options[document.form1.COUNTRY.selectedIndex].text);Select3Options('NULL');">
  <OPTION VALUE='$*'>---- SELECT ----
!IBI.FIL.CLIST1;
  </SELECT><BR>
-*
-* The 2nd dropdown this is populated by the action of the 1st dropdown
-* The onchange action runs the 3rd dropdown script and populates the 3rd dropdown box
-*
  <H4>[i]<font color="6A5ACD"> Select Car:</font>[/i]</H4>
  <SELECT WIDTH="300" STYLE="width: 200px" NAME="Select2" 
onchange="Select3Options(document.form1.Select2.options[document.form1.Select2.selectedIndex].text);">
  <OPTION VALUE='$*'>
 </SELECT><BR><BR>
-*
-* The 3rd dropdown box his is populated by the action of the 2nd dropdown or reset if the 1st dropdown is changed
-* The onchange action runs the final report by calling IBI_ex and passing it the parameter needed to bypass the script
-* processing and branch to the actual report code
-*
  <H4>[i]<font color="6A5ACD">  Select Model:</font>[/i]</H4>
  <SELECT WIDTH="300" STYLE="width: 200px" NAME="Select3" onChange="getProds('runreport');">
     <OPTION VALUE='$*'>
 </SELECT><BR><BR>

<BR><BR>
    </FORM>
  </BODY>
  </HTML>
-HTMLFORM END
-EXIT
-*
-runreport
-*
-* run the report
-* YOUR REPORT CODE FOLLOWS
-*
TABLE FILE CAR
PRINT COUNTRY CAR MODEL DEALER_COST RETAIL_COST
WHERE COUNTRY EQ '&COUNTRY'
WHERE CAR EQ '&Select2'
WHERE MODEL EQ '&Select3'
END

This message has been edited. Last edited by: <JG>,
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders