Focal Point
[CASE OPENED]Setting a Default Range of values with a slider control in HTML Composer

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

April 16, 2019, 01:15 PM
MReeder
[CASE OPENED]Setting a Default Range of values with a slider control in HTML Composer
Is there a way to set a default range for the slider control in the HTML Composer? I need for the slider to be forced to its min and max range on load.

I have tried the below javascript addition in the onInitialUpdate()

IbComposer_setCurrentSelection('slider3', 100, false);

But all this does is place the max value in the value box. The slider itself stays set at 0 - 0.

Thanks,

Marita

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


WebFOCUS 8.2.02M
Windows
Server/8.2.02M
All Outputs
April 16, 2019, 02:10 PM
MartinY
From a static slider (set to range from 0 to 200 step 10), the below work perfectly
function onInitialUpdate() {
 IbComposer_setCurrentSelection('slider1', 120, false);
}

And the default value can be anything up to 200 from the moment it's a multiple of 10.
But even that, I can set it at 125. Will not be able to select it again from the slider since the step is by 10, but can be typed in the selection box


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
April 16, 2019, 02:59 PM
MReeder
Martin, I have tried that but i only sets the box to a value of 120. The slider still remains at 0. Plus this is a range which needs the slider_from and slider_to to be set. I am not sure how to upload an image to show what I mean but it will visually not work as programmed. Thanks,


WebFOCUS 8.2.02M
Windows
Server/8.2.02M
All Outputs
April 16, 2019, 03:18 PM
MartinY
Here is my HTML code where only a slider is defined with a range from 0 to 200 and default to 120

From client, select the Public folder, right click on folder and select New / Text Editor. Paste the code and save it with htm extension. Then refresh your folder in AS and you will be able to see it with HTML Composer
<!DOCTYPE html>
<html><head><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="mycharsetmeta" http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252"><meta name="Generation" content="Created in release 8201, Generation 4"><meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <!-- Copyright 1996-2013 Information Builders, Inc. All rights reserved. -->
    
<script type="text/javascript">
//confidential_id=IBI_OptionsScript
var bRuntime=true;var szHtmlAlias="./ibi_html/";var is_mobile="false";var loadingscreen="";var ib_composer="ib_composer";var emf="ib_composer_emf";var ibiOptions = new Array(ib_composer);document.write('<script src="'+szHtmlAlias+'ibigbl.js" type="text/javascript"><\/script>');</script><script type="text/javascript">
//confidential_id=IBI_ibigblloadCss
if(typeof ibigblloadCss != 'function'){alert("JavaScript alias '"+szHtmlAlias+"'  is not valid.");window.location("about:blank");}</script><title>HtmlPage</title><script type="text/javascript">
//confidential_id=clientEventHandlersJS

if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
//Begin function window_onload
function window_onload() {
UpdateData();
}
function onInitialUpdate() {
 IbComposer_setCurrentSelection('slider1', 125, false);
}
</script><style type="text/css">.internal_default {
 }
 </style><!--//confidential_id=focus_xmlelement
<rootxmlnode focoption="_FOC_NULL" nextelementuniquenumber="1"><html_elements><html_body thumbnailscale="4" use_appl_css="no" checkserveraccess="yes" maptype="0" mobiledocument="no" loadiniframe="yes" responsivedesign="no" autofitchildren="no" edaconnectionrequired="false" ibiapp_app="" ismre="1" ibif_ex="/WFC/Repository/Public/SliderControl.htm"><html_event eventname="load" eventhandlername="window_onload"/><layer name="default"/></html_body><html_element bindcontrolid="slider1" layername="default" elementtype="37" inputcontrol="1" groupChildren="1" slider_step="1" slider_steps_perarrowclick="1" range="no" defaultselection="1" onetimepopulated="1"><link linktype="default" persistentuniqueid="compUid_1"><condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0"><data_info datatype="0" slider_range_from="0" sourcetype="typeMaster" slider_range_to="200" slider_step="10" selectedvalue="" checkForDuplicateValues="0" datasource="" ibif_ex=""><![CDATA[]]>
					
</data_info></condition></link></html_element><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/default_theme.css" bindcontrolid="LINK3" type="cssfile" UserSuppliedFullPath="1"/><html_element rtFileName="htmlpathsub/javaassist/ibi/html/composer/themes/nonBindows/IBI-Themes/bip-neutral.css" bindcontrolid="IBI_THEME_CSS" desc="Neutral" type="cssfile" UserSuppliedFullPath="1"/></html_elements><variables></variables><requests></requests><tasks><task id="load" trigger="load"/></tasks><animations></animations></rootxmlnode>
--></head>
<body class="IBI_PageBg"><div class="IBI_DesktopContainer IBI_temp_unselect" style="display: none;"><div tabindex="-1" class="internal_default" id="slider1" style="left: 110px; top: 70px; width: 430px; height: 30px; position: absolute; z-index: 1;" slider_range_from="0" slider_range_to="100"><a class="IBI_buttonSliderNav IBI_btn-left"></a><div class="IBI_SliderTrack" style="width: 321px;"><div class="IBI_SliderHandle"></div></div> 											<a class="IBI_buttonSliderNav IBI_btn-right"></a><input tabindex="1" class="IBI_ReportControlTarget IBI_rounded_s IBI_SliderInput" type="text"></div></div></body></html>
<!-- cc yklr -->



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
April 16, 2019, 03:33 PM
MReeder
Martin,

Yes this works great for a single slider. I am using a double slider. If you set properties/miscellaneous/Range to yes then it no longer works. The slider does not know which head to slide for the default number.

There must be something which says slider1_to and slider1_from but I have not been able to find enough documentation to determine the name for these values.

Thanks for your help! Smiler


WebFOCUS 8.2.02M
Windows
Server/8.2.02M
All Outputs
April 16, 2019, 03:49 PM
MartinY
Sorry, my bad. I haven't realized to you were using the range option.


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
April 16, 2019, 03:55 PM
MReeder
That is ok. I have searched all the technical content and have found no way to distinguish between the range of values to set the defaults. I'm going to open a case too and see if that will find an answer. If it does I will post it back to this chain.


WebFOCUS 8.2.02M
Windows
Server/8.2.02M
All Outputs
April 18, 2019, 05:09 AM
Addy
Hi,
Can you use Dynamic Slider instead of the static one?

Dynamic slider will give you an option to set you starting point to where you want..


WF 8.2.04
Windows/Unix
All Formats
In Focus since 2006