Utility Scripts for analysis : FilterCurvesByLength

 From:  mkdm
8608.7 In reply to 8608.6 
Hi Michael.

I'm trying to follow your suggestion but...things doesn't work.

Maybe I am misinterpreting what you wrote about sliders.

@You : "...they are only initialized when the control is initialized. So yes you would need to create an entire slider at once with your desired value like you're doing there..."

But...I'm trying this :

code:
<body class="commandbody">
...
...
<td colspan=3 id="minlensliderContainer">
	<script type="text/javascript">
		document.write("<moi:Slider id=\"minlenslider\" min=\"0\" max=\"" + wholeMaxLength + "\" style=\"width:100%\" onmousemovevaluechange=\"doFilter();\"/>");
	</script>
</td>
...
...


the problem is that I suppose this code is executed on the page load when I still haven't calculated the variable "wholeMaxLength", and its value is only a default.

But you write "...So yes you would need to create an entire slider at once with your desired value like you're doing there..."

But, again, the problem is that at load time, when the slider is rendered, I still don't have the correct value for that variable,
because I will calculate it into the "function init() {......"

I'm in a maze :)

What can I do ?

I have also thought a possible but complex solution, and I don't know if is it feasible.

That's my idea :

1) The crucial point is that I need calculate the value to assign to the attribute "max" of the slider, BEFORE the slider will be rendered

2) Now, I thought to break in two, the command that I'm writing (FilterCurvesByLength).

3) The first part will have no UI and only JS code that should calculate the value of the variable

4) Once the calculation is complete, I might redirect to the second part of the script, that contains the complete UI,
using something like "window.location.replace" or "window.location.href = ...",
passing to the HTML page the calculated variable with URL parameter.

5) in the receiving page I will capture the URL parameter hoping that this operation could be done BEFORE page rendering.


But, I don't know if these are only wrong considerations....

I really don't know how to solve this problem.

Any further aid will be much appreciated :)

Thanks.

- Marco (mkdm)