Focal Point
[SOLVED] Passing a parameter to dynamic drop down list

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

August 27, 2008, 09:44 AM
3RDCC
[SOLVED] Passing a parameter to dynamic drop down list
I am trying to populate a dynamic drop down list based on a fex that requires a parameter. The parameter is to be provided from a text box on the html page. I cannot figure out how to pass a parameter to the drop down list fex.

I already tried using a chained list which works for a limited number of records, but against a table with hundreds of thousands of records it never responds. Therefore the fex needs a parameter to limit the number of records retrieved.

Thanks,

Dave

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


WebFOCUS version 761.
Windows operating system. SQL Server database.
Output: Currently creating Excel and PDF report output.
August 27, 2008, 03:55 PM
Fernando
Dave,

If you have already tried a chain list with no success then a text box will not help you. You would eventually just chain to that.

Why did the chained list not work? Was it the value being passed did not filter the table enough to return a few rows. Was it the filter not being fast enough?

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
August 27, 2008, 05:22 PM
susannah
I can't do it either.
it chokes so easily
you can write a fex to retrieve the list in xml
rather than just point to the field in the db.
you point to the fex instead
and the fex is like:
TABLE FILE thing PRINT CODE CODENAME
ON TABLE PCHOLD FORMAT XML
END
but how you pass a previous parm to it, i have NO IDEA! I've been told AJAX.. if i ever find out, i'll repost here.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 28, 2008, 09:31 AM
3RDCC
Fernando,

The chained list did work on a smaller set of records, however on production data it retrieves hundreds of thousands of records before it trys to filter it and it never responds.

We thought that using a sql query in the dynamic drop list fex with a where clause would solve the problem. We cannot however pass that fex a parameter.

Is it possible to base a list on a sql query right in the HTML code?

Thanks.


WebFOCUS version 761.
Windows operating system. SQL Server database.
Output: Currently creating Excel and PDF report output.
August 28, 2008, 09:51 AM
Tony A
Dave,

Check out this post for a method I suggested to Jason when he had slow loading problems.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 28, 2008, 02:56 PM
Fernando
Dave,

If you want to run SQL that uses a parameter, then create fex that contains the SQL and then chain to that.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
August 28, 2008, 05:05 PM
3RDCC
Tony,

I tried following your example simply using two chained drop down lists and still cannot get the second list to populate. It seems as though this should have worked.

Fex for drop down list control #1...
TABLE FILE VW_TESTCASE
SUM FST.CASENBR
BY CASENBR
ON TABLE PCHOLD FORMAT XML
END

Fex for drop down list #2...
-DEFAULT &CaseNumber = 'FOC_NONE'
-SET &CaseNumber = IF &CaseNumber EQ 'FOC_NONE' THEN '~' ELSE &CaseNumber;

TABLE FILE VW_LISTCIVILDEFENDANT
SUM FST.PARTYNAME
BY PARTYNAME
WHERE CASENBR EQ '&CaseNumber'
ON TABLE PCHOLD FORMAT XML
END

The 2 controls are chained and control #1 is named CaseNumber. Is there something more I need to do in the Javascript or HTML code to pass the CaseNumber parameter?

Thanks,

Dave


WebFOCUS version 761.
Windows operating system. SQL Server database.
Output: Currently creating Excel and PDF report output.
August 28, 2008, 05:23 PM
Tony A
Dave,

Post the two select statements and the chain script from your launch page - don't forget to place you code between [ code] and [/code] tags on the forum.

I'll have a look tomorrow for you and let you know if I see anything wrong.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 29, 2008, 08:46 AM
3RDCC
Tony,

Here's the complete code. Thanks.

  
<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<TITLE>HtmlPage</TITLE>
<BASE href=HTTP://appiway:9080>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
}
//End function window_onload
</SCRIPT>

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>

<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true">
<SELECT id=combobox1 style="Z-INDEX: 1; LEFT: 260px; WIDTH: 200px; POSITION: absolute; TOP: 150px" tabIndex=1 name=CaseNumber cacheruntimedata="1" inchainindex="1" chainnumber="0" dynalldisplayvalue="ALL" addalloption="1" ibiapp_app="civil_dev" ibic_server="EDASERVE" sourcetype="typeFex" datatype="1" datafield displayfield datasource="ddl_case_number.fex" newchainnumber="0"></SELECT> 
<SELECT id=combobox2 style="Z-INDEX: 2; LEFT: 260px; WIDTH: 200px; POSITION: absolute; TOP: 200px" tabIndex=2 name=ddlDefendants cacheruntimedata="1" inchainindex="2" chainnumber="0" dynalldisplayvalue="ALL" addalloption="1" ibiapp_app="civil_dev" ibic_server="EDASERVE" sourcetype="typeFex" datatype="1" datafield displayfield datasource="ddl_defendants.fex" newchainnumber="0"></SELECT> </BODY></HTML>



WebFOCUS version 761.
Windows operating system. SQL Server database.
Output: Currently creating Excel and PDF report output.
August 29, 2008, 10:26 AM
susannah
3rd...
When creating an HTML launch page that has chained drop down list selection fields you have to edit the source code of the launch page and change all occurrences of cacheruntimedata = ‘1’ to cacheruntimedata = ‘0’.
-s




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 29, 2008, 12:14 PM
Tony A
Dave,

Where's the script for the chain array? Should be towards the bottom of the "true" HTML which is accessible via edit and not the painter.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 29, 2008, 01:29 PM
3RDCC
Tony,

Here's the missing code you asked for, although Susannah's suggestion fixed the problem!!

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true">
<SELECT id=combobox1 style="Z-INDEX: 1; LEFT: 260px; WIDTH: 200px; POSITION: absolute; TOP: 150px" tabIndex=1 name=CaseNumber newchainnumber="0" datasource="ddl_case_number.fex" displayfield datafield datatype="1" sourcetype="typeFex" ibic_server="EDASERVE" ibiapp_app="civil_dev" addalloption="0" dynalldisplayvalue="ALL" chainnumber="0" inchainindex="1" cacheruntimedata="0"></SELECT>
<SELECT id=combobox2 style="Z-INDEX: 2; LEFT: 260px; WIDTH: 200px; POSITION: absolute; TOP: 200px" tabIndex=2 name=ddlDefendants newchainnumber="0" datasource="ddl_defendants_sql.fex" displayfield datafield datatype="1" sourcetype="typeFex" ibic_server="EDASERVE" ibiapp_app="civil_dev" addalloption="0" dynalldisplayvalue="ALL" chainnumber="0" inchainindex="2" cacheruntimedata="0"></SELECT>
<INPUT id=ibiapp_app style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=civil_dev name=ibiapp_app>
<SCRIPT id=IBI_ChainScript type=text/javascript>
<!--
window.chain0=new Array(1);
window.chain0[0]=new String("combobox1;combobox2");
window.chain0[1]=0
//--></SCRIPT>


Thanks to everyone!!!


WebFOCUS version 761.
Windows operating system. SQL Server database.
Output: Currently creating Excel and PDF report output.