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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding All Option to Listbox

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Adding All Option to Listbox
 Login/Join
 
Member
posted
Hello All,

Hope you're doing well today. I have a question which I could not find an answer to through searching.

Is it possible to give a list box (that contains data) the 'ALL' option (from HTML Composer) through html/javascript?

When the user clicks on a specific report, the listbox turns from Single Selection to Multiple Selection, and I would like to have it also feature the 'ALL' option without having to already have it set as ON in the HTML Composer.

I currently have the following function that makes the selection multiple and if any other report is selected (counter > 1) then the selection remains single selection.

function SetMultipleScenario(repid, counter)	{
     if(repid=='421' && counter == 1) {	
         lb_wi_current.multiple=true;
	lb_wi_current.addalloption="1";
     } else {
	lb_wi_current.multiple=false;
     }
}

I attempted to use the addalloption above but failed. Is it possible to modify the below code (generated from HTML Composer) in such a manner?

 <data_info checkForDuplicateValues="1" sourcetype="typeMaster" datatype="1" modifiedrequest="1" cacheruntimedata="1" dosorting="1" sorttype="1" datasource="SCENARIOS_C.mas" displayfield="SCENARIO_NAME" datafield="13SCENID_NAME" selectedvalue="" operation="OR" accept="0" addalloption="0" dynalldisplayvalue="ALL" sortorder="1">
 



Thank you for your assistance!



EDIT: 3/30/2015 (My Birthday)


Found a solution. Just had to F12 to see what the HTML was for the HTML Composer specific code and it turned out to be an < option > so manipulation was made easy through the following code:

var opt = document.createElement('option');
opt.value='_FOC_NULL';
lb_wi_current.multiple=true;
lb_wi_current.appendChild(opt);
var options = document.getElementById("lb_wi_current");
options.insertBefore(opt, lb_wi_current.options[0]);
lb_wi_current.options[0].text='ALL';

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


WF 7.7.03 - W7 - HTML, PDF, EXL
 
Posts: 4 | Location: Florida | Registered: November 10, 2014Report This Post
Virtuoso
posted Hide Post
How do you build the data into your list box ? Is it loaded from a called fex ? Is it dynamic from HTML composer ?...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
quote:
Originally posted by MartinY:
How do you build the data into your list box ? Is it loaded from a called fex ? Is it dynamic from HTML composer ?...


The data is dynamic and added from an embedded procedure.


WF 7.7.03 - W7 - HTML, PDF, EXL
 
Posts: 4 | Location: Florida | Registered: November 10, 2014Report This Post
Virtuoso
posted Hide Post
If you have it called from a non-embedded procedure it would be relatively easy to call a fex that generate the data with the 'ALL' option or one without based on your selection criteria.

Or another option is to have two controls having the same position on the HTML but one with the 'ALL' option and the other without and then show or hide them according to the selection.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
Mike,

Is lb_wi_current.xxxxx something you developed or something anyone can use? I've been trying to figure out how to test what page within a portal a user is on, and depending on the page the user is on, controls within a filter.html hide/unhide or disable/enable. Do you know if this is possible?

Thanks!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Member
posted Hide Post
quote:
Originally posted by MartinY:
If you have it called from a non-embedded procedure it would be relatively easy to call a fex that generate the data with the 'ALL' option or one without based on your selection criteria.

Or another option is to have two controls having the same position on the HTML but one with the 'ALL' option and the other without and then show or hide them according to the selection.


Thank you for your methods Martin. I was hoping there would be a quick and easy way, sort of like a function or something to make it so but alas, I will proceed with the fun alternative.



quote:
Originally posted by CoolGuy:
Mike,

Is lb_wi_current.xxxxx something you developed or something anyone can use? I've been trying to figure out how to test what page within a portal a user is on, and depending on the page the user is on, controls within a filter.html hide/unhide or disable/enable. Do you know if this is possible?

Thanks!


You're a pretty Cool Guy, CoolGuy.
Nothing out of the ordinary here. Anyone can use the .multiple to set it as a multiple selection or single selection (the .addalloption was me trying to see if it was built in to WebFocus).

The pages that these users go on I'm assuming will have their own separate files? Because what you're asking for is totally feasible. There may be topics that cover such through the forum already as well if you haven't tried that.


WF 7.7.03 - W7 - HTML, PDF, EXL
 
Posts: 4 | Location: Florida | Registered: November 10, 2014Report This Post
Member
posted Hide Post
Found a solution. Just had to F12 to see what the HTML was for the HTML Composer specific code and it turned out to be an < option > so manipulation was made easy through the following code:

var opt = document.createElement('option');
opt.value='_FOC_NULL';
lb_wi_current.multiple=true;
lb_wi_current.appendChild(opt);
var options = document.getElementById("lb_wi_current");
options.insertBefore(opt, lb_wi_current.options[0]);
lb_wi_current.options[0].text='ALL';
 
Posts: 4 | Location: Florida | Registered: November 10, 2014Report This Post
Virtuoso
posted Hide Post
Edit your first post and add [SOLVED] at the beginning of the subject


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding All Option to Listbox

Copyright © 1996-2020 Information Builders