Focal Point
[CLOSED] HTML Composer: How to reset double-list control?

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

October 19, 2012, 06:47 PM
Francis Mariani
[CLOSED] HTML Composer: How to reset double-list control?
I'd like to use a javascript call to reset a double-list control when I click on a button.

I tried IbComposer_ResetDownChainControls, but that doesn't work, as it's not a chained control. I'd rather not have to make the double-list control chained to a dummy parent.

Thanks,

This message has been edited. Last edited by: FP Mod Chuck,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 19, 2012, 07:28 PM
Francis Mariani
Since this doesn't work:
IbComposer_ResetDownChainControls('customselect7' );
I tried this, which appears to reset the double-list - setting the control to any non-existent value will do the job:
IbComposer_setCurrentSelection('customselect7' ,'x');
The one thing I don't like is that the previously selected values are put at the bottom, which means I would need to use javaScript or jQuery to sort the selectfrom list box.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 06, 2012, 12:37 PM
MattC
quote:
The one thing I don't like is that the previously selected values are put at the bottom, which means I would need to use javaScript or jQuery to sort the selectfrom list box.


Did you find anything out about sorting the values correctly from the selectfrom?


WebFOCUS 8.1.05
November 06, 2012, 01:12 PM
Francis Mariani
Matt, unfortunately not.

In a previous project, onInitialUpdate I used jQuery to save the selectfrom listbox in a hidden listbox and the reset list box button would copy that hidden listbox back to selectfrom. A little convoluted but it worked and you don't really need to use jQuery...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 18, 2017, 12:58 PM
BM
quote:
IbComposer_setCurrentSelection('customselect7' ,'x');


HI,
I tried the method below.
But it pushes 'empty string' to the right box of the double list.
Is there a way around it?


var arr=[];
arr.push('');
IbComposer_setCurrentSelection('customselect1', arr, false);


WebFOCUS 8202M
June 05, 2017, 12:38 PM
Francis Mariani
BM, I believe I was in v7.7.03 when I posted my workaround. Sadly, often these workarounds don't work in the next release.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 06, 2017, 06:25 AM
Wep5622
I would think that just the below should work to reset the selection:
IbComposer_setCurrentSelection('customselect1', [], false);


Are you sure the unique id of that field is indeed 'customselect1'? Are you seeing any javascript errors in the console (F12)?


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
June 14, 2017, 10:39 AM
BM
Hi,
here is the solution.
document.getElementById('customselect1_selectto').options.length = 0;


Thanks


WebFOCUS 8202M