Closed Bug 299602 Opened 19 years ago Closed 19 years ago

"curpos" attribute of scrollbar is not maintained

Categories

(Core :: XUL, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: tennessee, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+

Test case below. According to the tutorial and element reference, the attribute
"curpos" should be an integer indicating the current position of the scrollbar.
Instead, it seems always to be undefined.

Reproducible: Always

Steps to Reproduce:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window
    id="findfile-window"
    title="Bureau of Meteorology Data Viewer"
    orient="horizontal"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:html="http://www.w3.org/1999/xhtml"
    align="start"
>

                   
    <vbox tooltiptext="0Z Data">
	<scrollbar id="timeScroller" curpos="0" maxpos="24" orient="horizontal"
oncommand="doTimeScroller();" editable="false" pageincrement="6" />
	<label value="Selected Forecast Hour: 0 -- THIS WIDGET IS BROKEN"  />
    </vbox>
    
    <script>
    
	timeScroller = document.getElementById("timeScroller");

	var timeCount = 0;	
	
	function doTimeScroller() {
		timeCount = timeScroller.curpos;
		alert(timeScroller + " caused event -- count now " + timeCount);

	}
    
    </script> 
    
    
</window>
This is essentially an attempt to build a slider widget. I have since found
reference to a slider tag which isn't part of the major documentation, but is at
least partially useable. I tried to use it directly, and came up with
essentially the same problem. Assuming that the scrollbar is based on the
slider, it looks like the problem is in the slider code itself rather than in
the binding.

<slider id="timeSlider" flex="1" oncommand="doTimeSlider();" style="background:
#ddd;" maxpos="24" curpos="5">
    <thumb/>
</slider>

also exhibits the problem of curpos being undefined.
Forget it, I'm lame. I just needed to do .getAttribute("curpos") instead. Sorry.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → WORKSFORME
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.