Closed Bug 458183 Opened 16 years ago Closed 1 year ago

Column tree splitters do not work in bindings

Categories

(Toolkit :: UI Widgets, defect)

1.9.0 Branch
x86
All
defect

Tracking

()

RESOLVED INACTIVE

People

(Reporter: yak, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008082210 Gentoo Firefox/3.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008082210 Gentoo Firefox/3.0.1

In a XUL tree, when splitters are put between columns they are not accessible and columns are not resizable. This happens only in bindings, if the columns do or do not have IDs.


Reproducible: Always

Steps to Reproduce:
1.Create a XUL tree with > 2 columns and splitters between them (in a binding)
2.Attach the binding to a box
3.
Actual Results:  
The tree is rendered, the columns are not resizable. Any kind of listing is broken because with the barrow columns, data cannot be viewed.

Expected Results:  
The columns should be resizable

<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
	
<binding
	id="mytree"
	extends="xul:box"
	inherits="flex">
		
	<content>
			
			
<xul:tree flex="1">
     <xul:treecols>
    <xul:treecol label="Sender"/>
    <xul:splitter class="tree-splitter"/>
    <xul:treecol label="Subject2" />
    <xul:splitter class="tree-splitter" />
    <xul:treecol label="Subject3" flex="1"/>
    <xul:splitter class="tree-splitter" />
  </xul:treecols>

  <xul:treechildren>
    <xul:treeitem>
      <xul:treerow>
        <xul:treecell label="joe@somewhere.com"/>
        <xul:treecell label="Top secret plans"/>
	<xul:treecell label="Top secret plans"/>
      </xul:treerow>
    </xul:treeitem>
    <xul:treeitem>
      <xul:treerow>
        <xul:treecell label="mel@whereever.com"/>
        <xul:treecell label="Let's do lunch"/>
	<xul:treecell label="Let's do lunch"/>
      </xul:treerow>
    </xul:treeitem>
  </xul:treechildren>
</xul:tree>

	</content>
</binding>
</bindings>
Version: unspecified → 3.0 Branch
Component: Extension Compatibility → XUL Widgets
Product: Firefox → Toolkit
QA Contact: extension.compatibility → xul.widgets
Version: 3.0 Branch → 1.9.0 Branch
I see that as well.  Any workaround?
anyone interesting in fixing this ugly bug? all xul applications with trees and listings are now ****.
Columns resize is working after clicked to "Restore Defaults" in column picker
Reproduced in various behaviors:

teste.css:
.mytree {   -moz-binding: url('teste.xbl#mytree'); }

teste.xul
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="teste.css" type="text/css"?>

<window id="example-window" title="Example 8.1.2"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
	<box height="200">
		<groupbox flex="1">
			<caption label="1 UNHIDDEN splitter, treechildren, WORKS" />
			<tree flex="1"  enableColumnDrag="true" >
			  <treecols>
				<treecol id="sender" label="Sender" flex="1"/>
				<splitter/>
				<treecol id="subject" label="Subject" flex="2"/>
			  </treecols>

			  <treechildren>
				<treeitem>
				  <treerow>
					<treecell label="out"/>
					<treecell label="out"/>
				  </treerow>
				</treeitem>
			  </treechildren>
			</tree>
		</groupbox>
		<groupbox flex="1">
			<caption label="2 UNHIDDEN splitter, without treechildren, FAIL" />
			<tree flex="1"  enableColumnDrag="true" >
			  <treecols>
				<treecol id="sender" label="Sender" flex="1"/>
				<splitter/>
				<treecol id="subject" label="Subject" flex="2"/>
			  </treecols>
			</tree>
		</groupbox>
		<groupbox flex="1">
			<caption label="3 HIDDEN splitter, without treechildren, WORKS" />
			<tree flex="1"  enableColumnDrag="true" >
			  <treecols>
				<treecol id="sender" label="Sender" flex="1"/>
				<splitter class="tree-splitter"/>
				<treecol id="subject" label="Subject" flex="2"/>
			  </treecols>
			</tree>
		</groupbox>
	</box>
	<box height="200" class="mytree"/>
</window>

teste.xbl
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
          xmlns:xbl="http://www.mozilla.org/xbl"
          xmlns:html="http://www.w3.org/1999/xhtml"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

	
	<binding id="mytree">
    <content>
		<xul:groupbox flex="1">
			<xul:caption label="1 same in XBL, FAIL" />
			<xul:tree flex="1" enableColumnDrag="true" >
			  <xul:treecols>
				<xul:treecol id="sender" label="Sender" flex="1"/>
				<xul:splitter/>
				<xul:treecol id="subject" label="Subject" flex="2"/>
			  </xul:treecols>

			  <xul:treechildren>
				<xul:treeitem>
				  <xul:treerow>
					<xul:treecell label="in XBL"/>
					<xul:treecell label="in XBL"/>
				  </xul:treerow>
				</xul:treeitem>
			  </xul:treechildren>
			</xul:tree>
		</xul:groupbox>
		<xul:groupbox flex="1">
			<xul:caption label="2 same in XBL, FAIL" />
			<xul:tree flex="1"  enableColumnDrag="true" >
			  <xul:treecols>
				<xul:treecol id="sender" label="Sender" flex="1"/>
				<xul:splitter/>
				<xul:treecol id="subject" label="Subject" flex="2"/>
			  </xul:treecols>
			</xul:tree>
		</xul:groupbox>
		<xul:groupbox flex="1">
			<xul:caption label="3 same in XBL, WORKS" />
			<xul:tree flex="1"  enableColumnDrag="true" >
			  <xul:treecols>
				<xul:treecol id="sender" label="Sender" flex="1"/>
				<xul:splitter class="tree-splitter"/>
				<xul:treecol id="subject" label="Subject" flex="2"/>
			  </xul:treecols>
			</xul:tree>
		</xul:groupbox>
    </content>
</binding>
</bindings>

If has more than one splitter when clicked 1 time to "Restore Defaults" we can see splitter changes it position but not to the correct one, just when clicked 2 times there splitter works.

Splitter in XBL works when has no <treechildren> tag and class="tree-splitter"
Blocks: 450553
I've also found that the splitter resizing works if the splitter elements are added dynamically with code something like the following:

    // HACK: Dynamically add the tree column splitters to workaround
    // a Mozilla 1.9 bug where tree splitters in XBL bindings don't
    // work (Komodo bug 80566, Mozilla bug 458183).
    var s;
    var treecols = treeWidget.firstChild;
    var length = treecols.childNodes.length;
    for (var i = length - 1; i > 0; i--) {
        //dump("add splitter before treecol "+i+" ("
        //     +treecols.childNodes[i].getAttribute("id")+")\n");
        s = document.createElementNS(
            "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "splitter");
        s.setAttribute("class", "tree-splitter");
        treecols.insertBefore(s, treecols.childNodes[i]);
    }


This is from the patch we'll be using to fix this issue in Komodo (http://bugs.activestate.com/show_bug.cgi?id=80566).
In Firefox this hack also seems to work, it has the effect of clicking the natural order button in the column picker:

var my_tree = document.getAnonymousElementByAttribute(this,'IDanon','datree');
my_tree.columns.restoreNaturalOrder();

This can be put in the constructor of the binding.
Status: UNCONFIRMED → NEW
Ever confirmed: true

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.