If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

XULElement Tree. The scrollbar invalid value maxpos if I call method invalidate() for nsITreeBoxObject

RESOLVED INVALID

Status

()

Core
XUL
RESOLVED INVALID
14 years ago
9 years ago

People

(Reporter: dmitry rusanov, Assigned: janv)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007

I have Object EventLogBuffer

If I call method addRecord , Tree add row, scroll bar maxpos value invalid(very
big).

object:
function EventLogBuffer()
{
	//	members
	
	this.m_treebox = undefined;
	this.m_lastID = 0;
	this.m_records = [];
	
	//	props
	
	this.lastID getter = function()
	{
		return this.m_lastID;
	}
	
	//	methods
	
	this.addRecord = function(id, type, date, time, source, event, user, computer,
comment, data)
	{
		this.m_records.unshift(new EventLogRecord(type, date, time, source, event,
user, computer, comment, data));
		
		if (id > this.m_lastID)
			this.m_lastID = id;
		
		if (this.m_treebox)
		{
			this.m_treebox.rowCountChanged(this.m_records.length, this.m_records.length);
			this.m_treebox.invalidate();
		}
	}
	
	//	treeview
	
	this.rowCount getter = function()
	{
		return this.m_records.length;
	}
	
	this.getCellText = function(row, column)
	{
		if (column == 'type-col')
		{
			return this.m_records[row].type;
		}
		
		else if (column == 'date-col')
		{
			return this.m_records[row].date;
		}
		
		else if (column == 'time-col')
		{
			return this.m_records[row].time;
		}
		
		else if (column == 'source-col')
		{
			return this.m_records[row].source;
		}
		
		else if (column == 'event-col')
		{
			return this.m_records[row].event;
		}
		
		else if (column == 'user-col')
		{
			return this.m_records[row].user;
		}
		
		else if (column == 'computer-col')
		{
			return this.m_records[row].computer;
		}
		
		ASSERT(false, "unknown column name");
		return "unknown column name";
	}
	
	this.setTree = function(treebox)
	{
		this.m_treebox = treebox;
	}
	
	this.isContainer = function(row)
	{
		return false;
	}

	this.isSeparator = function(row)
	{
		return false;
	}
	
	this.isSorted = function(row)
	{
		return false;
	}
	
	this.getLevel = function(row)
	{
		return 0;
	}
	
	this.getImageSrc = function(row, col)
	{
		return null;
	}
	
	this.getRowProperties = function(row, props)
	{
	}
	
	this.getCellProperties = function(row, col, props)
	{
	}
	
	this.getColumnProperties = function(colid, col, props)
	{
	}
}

xul element:

							<tree id="eventlog-data-tree" flex="1">
							
								<treecols>
									<treecol id = "type-col" label = "&eventlog-type-column:label;" flex =
"1" persist="width ordinal hidden"/>
									<splitter class="tree-splitter"/>
									
									<treecol id = "date-col" label = "&eventlog-date-column:label;" flex =
"1" persist="width ordinal hidden"/>
									<splitter class="tree-splitter"/>
									
									<treecol id = "time-col" label = "&eventlog-time-column:label;" flex =
"1" persist="width ordinal hidden"/>
									<splitter class="tree-splitter"/>
									
									<treecol id = "source-col" label = "&eventlog-source-column:label;"
flex = "1" persist="width ordinal hidden"/>
									<splitter class="tree-splitter"/>
									
									<treecol id = "event-col" label = "&eventlog-event-column:label;" flex
= "1" persist="width ordinal hidden"/>
									<splitter class="tree-splitter"/>
									
									<treecol id = "user-col" label = "&eventlog-user-column:label;" flex =
"1" persist="width ordinal hidden"/>
									<splitter class="tree-splitter"/>
									
									<treecol id = "computer-col" label="&eventlog-computer-column:label;"
flex="1" persist="width ordinal hidden"/>
									<splitter class="tree-splitter"/>
								</treecols>
								
								<treechildren/>
							</tree>


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
dmitry, please attach a testcase file to this bug using
http://bugzilla.mozilla.org/attachment.cgi?bugid=224746&action=enter

Comment 2

14 years ago
this.m_treebox.rowCountChanged(this.m_records.length, this.m_records.length);

This is not how you use rowCountChanged!

The first parameter to rowCountChanged is the first affected row.
The second parameter is the number of affected rows.

In this case you want to use rowCountChanged(0, 1);
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID

Updated

9 years ago
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.