[Solved] Tying Two Dynamic Pulldown Menus together
I am trying to get the pulldown menus on my report (built in html composer), to act like the pulldown menus on a automobile sales site. You know how you choose the make, then when you get to the model pulldown it is only the models for that make?
I have a department pulldown and a employee pulldown.
Using the chain + button in composer is not working. If I tie these fields together, and run the report, the dynamic pulldown menus no longer populate.
If I choose Finance from the Department pulldown, the employee pulldown should only show employees from the finance department.
Is their a webfocus 'trick' for this?
GregThis message has been edited. Last edited by: Greg,
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
July 08, 2009, 08:34 AM
Mighty Max
Do a search on chaining and dropdowns.
Basically you will need to write a fex that will create the data for the Department dropdown. Then you will need to create a second fex that will create the data for the Employee dropdown that is filtered based on the Department dropdown selection.
Chaining is not working. I select the department pulldown, hold control, select the employees pulldown, click the chain + button, but when I run the report both chained drop down menus are empty.
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
July 08, 2009, 09:38 AM
Mighty Max
Check your chain order. How are you populating the data into the dropdowns? From a Data Source (master file) or Procedure (fex file)? Open your HTML Report Painter file in Text Editor and post it. Maybe someone can spot something.
Here is the code with chaining enabled. The department ID and Employees drop downs are empty.
<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<TITLE>HtmlPage</TITLE>
<BASE href=HTTP://Demeter:80>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload
</SCRIPT>
<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true">
<FORM id=form2 style="Z-INDEX: 2; LEFT: 90px; WIDTH: 580px; POSITION: absolute; TOP: 90px; HEIGHT: 300px" tabIndex=2 name=form2 onsubmit="OnExecute(this);return false;" method=post requests_list="0" form_dist_between_desc_and_input="10" form_hor_dist_between_controls="10" vert_dist_between_controls="10" form_number_of_columns="4" form_number_of_visible_rows="4" form_prompt_location="1" default_slider_type="4" fexlist_list="report1">
<INPUT id=form2Submit style="Z-INDEX: 3; LEFT: 0px; BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/run16.gif); WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; POSITION: absolute; TOP: 278px; HEIGHT: 22px; BACKGROUND-COLOR: lavender" tabIndex=3 type=submit value=" " name=ITEM1>
<INPUT id=form2Reset style="Z-INDEX: 4; LEFT: 40px; BACKGROUND-IMAGE: url(/ibi_html/javaassist/ibi/html/describe/reset.gif); WIDTH: 38px; BACKGROUND-REPEAT: no-repeat; POSITION: absolute; TOP: 278px; HEIGHT: 22px; BACKGROUND-COLOR: lavender" tabIndex=4 type=reset value=" " name=reset1>
<FIELDSET id=form2_formbodyid style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; Z-INDEX: 5; LEFT: 0px; PADDING-BOTTOM: 0px; OVERFLOW: auto; WIDTH: 560px; BORDER-TOP-STYLE: none; PADDING-TOP: 0px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; POSITION: absolute; TOP: 10px; HEIGHT: 260px; BORDER-BOTTOM-STYLE: none" tabIndex=5 formbody="1" tempwidth="389" tempheight="72">
<SPAN id=pane1 style="Z-INDEX: 6; LEFT: 0px; WIDTH: 500px; POSITION: absolute; TOP: 0px; HEIGHT: 51px" tabIndex=6 elementtype="32" name="DEPT">
<FONT style="FONT-FAMILY: Arial">Department ID</FONT>
<SELECT id=edit1 style="LEFT: 0px; POSITION: absolute; TOP: 29px" tabIndex=7 size=1 name=DEPT start="fileopen" readOnly="false" height="83029804" hspace="0" maxLength="10" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0" sourcetype="typeMaster" datatype="1" requiredfield="1468506" boundtovariable="1" datasource="ps_kv_pnch_ana_vw.mas" selectedvalue operation="NONE" addalloption="0" datafield="DEPTID" displayfield="DEPTID" ibiformat="A10V" dfformat="A10V" defaultlocation="29,0,51,95" rawvalue="FOC_NONE" dynalldisplayvalue="ALL" chainnumber="0" inchainindex="1" cacheruntimedata="1"></SELECT></SPAN>
<SPAN id=pane2 style="Z-INDEX: 8; LEFT: 0px; WIDTH: 500px; POSITION: absolute; TOP: 60px; HEIGHT: 60px" tabIndex=8 elementtype="32" name="NAME">
<SELECT id=edit2 style="LEFT: 0px; WIDTH: 260px; POSITION: absolute; TOP: 38px" tabIndex=9 size=1 name=NAME start="fileopen" readOnly="false" height="80106748" hspace="0" maxLength="50" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0" sourcetype="typeMaster" datatype="1" requiredfield="1468506" boundtovariable="1" datasource="ps_kv_pnch_ana_vw.mas" selectedvalue operation="NONE" addalloption="1" datafield="PERSONFULLNAME" ibiformat="A50V" defaultlocation="29,0,51,65" rawvalue="ALL" dynalldisplayvalue="ALL" newchainnumber="0" chainnumber="0" inchainindex="2" cacheruntimedata="1"></SELECT>
<SPAN id=text2 style="Z-INDEX: 15; LEFT: 0px; WIDTH: 330px; POSITION: absolute; TOP: 10px; HEIGHT: 19px" tabIndex=15>
<FONT style="FONT-FAMILY: Arial">Choose Employee or Use All </FONT></SPAN></SPAN>
<SPAN id=pane3 style="Z-INDEX: 10; LEFT: 0px; WIDTH: 180px; POSITION: absolute; TOP: 130px; HEIGHT: 51px" tabIndex=10 elementtype="32" name="START_DATE">
<FONT style="FONT-FAMILY: Arial">Start Date</FONT> </SPAN>
<SPAN id=pane4 style="Z-INDEX: 12; LEFT: 0px; WIDTH: 180px; POSITION: absolute; TOP: 190px; HEIGHT: 60px" tabIndex=12 elementtype="32" name="END_DATE">End Date
<INPUT id=calendar2 style="Z-INDEX: 18; LEFT: 0px; WIDTH: 130px; POSITION: absolute; TOP: 30px; HEIGHT: 21px" tabIndex=18 accept=0 size=14 name=END_DATE elementtype="14" sourcetype="typeMaster" datatype="0" boundtovariable="1" datasource selectedvalue operation="NONE" addalloption="0" ibiformat="MDYY" calendardata="0/0/-10;0/0/10" calendardatatype="1"></SPAN>
<INPUT id=calendar1 style="Z-INDEX: 17; LEFT: 0px; WIDTH: 130px; POSITION: absolute; TOP: 160px" tabIndex=17 accept=0 name=START_DATE elementtype="14" sourcetype="typeMaster" datatype="0" boundtovariable="1" datasource selectedvalue operation="NONE" addalloption="0" ibiformat="MDYY" calendardata="0/0/-10;0/0/10" calendardatatype="1"></FIELDSET></FORM>
<SPAN id=text1 style="Z-INDEX: 14; LEFT: 180px; WIDTH: 400px; FONT-FAMILY: Arial; POSITION: absolute; TOP: 30px; HEIGHT: 30px" tabIndex=14>Leave Usage Report</SPAN>
<IMG id=image1 style="Z-INDEX: 16; LEFT: 90px; POSITION: absolute; TOP: 10px" tabIndex=16 src="C:\DOCUME~1\cpisgb1\LOCALS~1\Temp\ddm_0000a.jpg" border=0 name=image1 originalWidth="73" originalHeight="73" rtFileName="app/comp_logo_small_white_back.jpg">
<xml id=ibi_requests>
<script>
<requests>
<request requestid="0" targetname="report1" ibif_ex="report1" targettype="iframe" sourcetype="typeAdhocfex" activereport="0" reportcolumns="" ibiapp_app="" paramremovedbyuser="START_DATE&END_DATE">
<![CDATA[-* Begin MR Prefix *-
-SET &SECTION='PREFIX';
-INCLUDE mrv/ps_kv_pnch_ana_vw.fex
-* End MR Prefix *-
DEFINE FILE PS_KV_PNCH_ANA_VW ADD
-* DEFINE BEGIN PAYCODE
PAYCODE/A20 = IF PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.COMMENTTEXT
EQ 'PL - Scheduled'
THEN 'PERS'
ELSE IF PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.COMMENTTEXT
EQ 'PL - Unscheduled'
THEN 'PERU'
ELSE PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.PAYCODENAME;
-* DEFINE END PAYCODE
END
TABLE FILE PS_KV_PNCH_ANA_VW
-* Begin MR Suffix *-
-SET &SECTION='WHERE';
-INCLUDE mrv/ps_kv_pnch_ana_vw.fex
-* End MR Suffix *-
-* HTML Tool
-* Created by Report Assistant
-* FF Line do not change this line! Field Name
-* FF Line do not change this line! Alias
-* FF Line do not change this line! Format
-* FF Line do not change this line! Segment
-* FF Line do not change this line! ShowFieldTree
-* FF Line do not change this line! displayTree=0
SUM PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.PUNCHTIME/P19.2 AS 'HOURS'
BY PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.PERSONFULLNAME SUBTOTAL AS '*TOTAL'
BY PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.PUNCHDATE
ACROSS PAYCODE
WHERE (PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.DEPTID CONTAINS '&DEPT')
AND (PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.PERSONFULLNAME CONTAINS '&NAME')
AND (PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.PUNCHDATE GE '&START_DATE')
AND (PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.PUNCHDATE LE '&END_DATE');
HEADING
"DEPARTMENT <PS_KV_PNCH_ANA_VW.PS_KV_PNCH_ANA_VW.DEPTID"
""
""
ON TABLE SET STYLE *
-INCLUDE IBFS:/CFG/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENDefaultTableStyle.sty
TYPE=REPORT,
GRID=OFF,
$
TYPE= HEADING,$
ENDSTYLE
ON TABLE SET HTMLCSS OFF
ON TABLE SET OLAPPANE CONTROL
ON TABLE COLUMN-TOTAL
END
-* End Report Assistant
-SET &SECTION='SUFFIX';
-INCLUDE mrv/ps_kv_pnch_ana_vw.fex]]>
<variables>
<variable parametercreatedinreslay="0" displayfield="DEPT" format="" field="DEPT" file="ps_kv_pnch_ana_vw.mas" desc="DEPT" datatype="0" operation="" default="" name="DEPT" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable>
<variable parametercreatedinreslay="0" displayfield="NAME" format="" field="NAME" file="ps_kv_pnch_ana_vw.mas" desc="NAME" datatype="0" operation="" default="" name="NAME" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable>
<variable parametercreatedinreslay="0" displayfield="START_DATE" format="" field="START_DATE" file="ps_kv_pnch_ana_vw.mas" desc="START_DATE" datatype="0" operation="" default="" name="START_DATE" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable>
<variable parametercreatedinreslay="0" displayfield="END_DATE" format="" field="END_DATE" file="ps_kv_pnch_ana_vw.mas" desc="END_DATE" datatype="0" operation="" default="" name="END_DATE" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable></variables></request></requests></script>
</xml></BODY></HTML>
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
July 08, 2009, 11:12 AM
Mighty Max
I always make sure that my dropdown controls have the same names and unique ids as the fields that I am binding them to. On the Properties Tab of the Department dropdown. Make the Name DEPTID and Unique Identifier DEPTID. On the Properties Tab of the Employee dropdown. Make the Name PERSONFULLNAME and Unique Identifier PERSONFULLNAME.
Using Parameter Tab redo the population of each dropdown to the datasource. You should see the Value Field and Display Field have the corresponding field names. Go back and redo the chaining making sure that chain order is correct. Also, rebuild the hyperlink for the run button. After rebuilding the hyperlink the Parameter column on the Parameter tab should populate with the corresponding fields.
Just a thought regarding the statement by Mighty Max (08:34): "Basically you will need to write a fex...". IF the departments and the employees are in files, THEN you can use the Dynamic / Data Source parameter option instead of writing additiona fexes ELSE write additiona fexes to do it.