Closed Bug 178212 Opened 23 years ago Closed 22 years ago

menulist does not drop down when it is in a listbox cell

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: doyle, Assigned: janv)

Details

Attachments

(2 files, 6 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20021016 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20021016 Using the following code I can see the arrow on the drop down lit box fine. Nothing happens when I click on it. I have to click on the box part of the menu list for anything to happen. Also when I set the contents as non-editable, the user can edit them anyway. I have used editable="none" and editable="false" and taken out this property so that the default would kick in, all with no success. As you can also see I have had to include JS code to mimic some of the normal funcionality of a menulist. I do not get this issue when the menulist is in grid widget or just alone in a window. <script type="application/x-javascript"> function myListBox(listboxid) { //alert(listboxid); var listbox = document.getElementById(listboxid); if(listbox.open) { listbox.open = false; } else { listbox.open = true; } return; } function myPopUpMenu(listboxid) { //alert(listboxid); var listbox = document.getElementById(listboxid); if(listbox.open) { listbox.open = false; } else { listbox.open = true; } return; } </script> <groupbox flex="2"> <caption label="Phyiscal Characteristics"/> <listbox rows="2" class="list" id="physicalcharacteristics-list" flex="1"> <listcols> <listcol flex="2"/> <splitter state="open" class="tree-splitter"/> <listcol flex="1"/> <splitter class="tree-splitter"/> <listcol flex="1"/> <splitter class="tree-splitter"/> </listcols> <listhead> <listheader label="Description" /> <listheader label="Value" /> <listheader label="UOM" /> </listhead> <listitem id="height-item"> <listcell label="Height" /> <listcell> <textbox id="heightvaluevalue-text-cell" class="textcell" value="68.00" flex="1"/> </listcell> <listcell type="menupopup "> <menulist label="" id="heightuom-text-cell" editable="none" onclick="myListBox('heightuom-text-cell')"> <menupopup flex="1" onclick="myPopUpMenu('heightuom-text-cell')" > <menuitem label="Inches"/> <menuitem label="Feet"/> <menuitem label="Centimeters"/> <menuitem label="Milimeters"/> </menupopup> </menulist> </listcell> </listitem> </listbox> </groupbox> Reproducible: Always Steps to Reproduce: 1. Use code above 2. Click on arrow to left on menu list, nothing happens 3. Select an item from teh list by clicking in the text area of the list and choosing your value. 4. You can then edit the value in the text area, you should not be able to this. Actual Results: Result where that the arrow does not work in the menu list and that the listitem value in the textarea of the menulist iseditable. Expected Results: It should allow the user to click on the arrow of the menulist so that the user can select a value from th list. After the user has selected a value from the list by click the list should disapear and the textare of the menulist should have the value the user choose ffrom the list. This value in teh text are should not be editable.
Summary: menulist act as normal when it is in a listbox cell → menulist DOES NOT act as normal when it is in a listbox cell
XUL
Assignee: sgehani → hyatt
Component: XP Apps → XP Toolkit/Widgets: XUL
QA Contact: paw → shrir
Jan, any ideas? Kevin, could you possibly post a complete XUL testcase using http://bugzilla.mozilla.org/attachment.cgi?bugid=178212&action=enter ?
You will notice the menulists on the right work as they should. When the menulist on the left in the list box it does not work the same. It is also set to be none editable and it allows edits. There is JavaScript to make the menu behave somewhat as expected.
> It is also set to be none editable The editable attribute does not take values. If it's set, the list is editable. If it's not set, the list is not editable. If I remove the "editable" part, I see the problem with the menulist not dropping down... confirming and over to trees.
Assignee: hyatt → varga
Status: UNCONFIRMED → NEW
Component: XP Toolkit/Widgets: XUL → XP Toolkit/Widgets: Trees
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Summary: menulist DOES NOT act as normal when it is in a listbox cell → menulist does not drop down when it is in a listbox cell
well, if you put in: <lisitem allowevents="true"> all is fine. maybe you want to modify this in the XBL listbox.xml. just put it in the content's tag: <content allowevents="true"> I will post a patch file for listbox.xml ---- about editable="none", in xul.css: menulist[editable]{ so...1) do nothing; or 2) menulist[editable="true"]{ I think it's better "do nothing".
Attached patch proposed patch for listbox.xml (obsolete) — Splinter Review
Comment on attachment 113835 [details] [diff] [review] proposed patch for listbox.xml Jag? Neil? What do you think?
Attachment #113835 - Flags: superreview?(jaggernaut)
Attachment #113835 - Flags: review?(neil)
I have an not desired secondary effect, with my patch: you can't, select the complete row, because you make an allowevent.
ok, I will post a new proposed patch. the anonymous tag listrows is who make exclution rule (if seltype="single") or add listitem (if seltype="multiple"). it does that in handler tags, testing if event.target.localName == "listitem" allowevents="true" it's necesary to allow click inside the listitem, but that makes change it its event.target. In the XUL file attached, in first listcell event.target is label, in second is a textbox, a so on... to solve it, in listitem binding add one handler event="click", there I create an event type MouseEvent which takes parameter from foreign click event and use it. So listrows tag feel no diference...
Attached patch proposed patch (obsolete) — Splinter Review
Attachment #113835 - Attachment is obsolete: true
Ariel, please move the review flags over to your updated patch....
Attachment #113835 - Flags: superreview?(jaggernaut)
Attachment #113835 - Flags: review?(neil)
Attachment #113858 - Flags: superreview?(neil)
Attachment #113858 - Flags: review?(neil)
Attachment #113858 - Flags: superreview?(neil) → superreview?(jaggernaut)
well, during the weekend I have tested the patch, and it has a problem with multiple selections. (seltype="multiple"), because it doesn't have a listener for mouse event "mousedown" in the listitem tag. so I will post a new patch (I would like to think that it's my last patch in this bug :-) ). The new one has tested better than the previous one.
Attached patch a much better patch (obsolete) — Splinter Review
Attachment #113858 - Attachment is obsolete: true
Attachment #113858 - Flags: superreview?(jaggernaut)
Attachment #113858 - Flags: review?(neil)
Attachment #114014 - Flags: superreview?(jaggernaut)
Attachment #114014 - Flags: review?(neil)
Comment on attachment 114014 [details] [diff] [review] a much better patch > allowevents="true" it's necesary to allow click inside the listitem, > but that makes change it its event.target. In the XUL file attached, > in first listcell event.target is label, in second is a textbox, and > so on... Then wouldn't it be better to locate the containing listitem?
Attachment #114014 - Flags: review?(neil) → review-
you can't localice the listitem. You don't know how deep can be the target in the listitem. so, you would need a diferent code for: <listitem label="blabla"/> in the most common case, and: <listitem> <listcell label="blabla"/> <listcell label="otherbla"/> </listitem> and <listitem> <listcell> <menulist> <menupopup> <menuitem label="one"/> </menupopup> </menulist> </listcell> <listcell> <label value="bla"/> </listcell> </listitem> all of this options have diferente references to the listitem tag. So you can't take the listitem from the event.target. exist other way: 1. handle "click" and "mousedown" in listitem. 2. from handler call to method in the listrow's implementation. 3. methods in 2 are the actual handlers of "click" and "mousedown", and I pass the listitem's reference. if you prefer this option, I would write other patch, for you can have more options...
I will post a new patch based in methods, not in events... so works too, just it's a diferente proposed patch... I delete handlers from listrows tag, and I added them as methods in listbox tag. I put two handler in listitem to call this methods.
Attached patch other kind of patch (obsolete) — Splinter Review
perseverancia....
Attachment #114027 - Flags: superreview?(jaggernaut)
Attachment #114027 - Flags: review?(neil)
Comment on attachment 114027 [details] [diff] [review] other kind of patch This is usable but I would prefer you to put all the code in the handler, rather than using the two extra methods. Also your patch did not apply; one problem was the white-space only diffs, the other problem is that you appear to be using a three month old version of listbox.xml
Attachment #114027 - Flags: review?(neil) → review-
well, I understood... it's time!!! :-) [but later it's better than never] now, I has last listbox.xml. I put the methods in the handlers, and the handlers in listitem tag... it has tested and works... just it's waiting I post it...
fixing warnings! :-)
Attachment #114014 - Attachment is obsolete: true
Attachment #114027 - Attachment is obsolete: true
Attachment #114113 - Attachment description: I would think the last. → I would like to think that it's my last patch in this bug
Attachment #114113 - Flags: superreview?(jaggernaut)
Attachment #114113 - Flags: review?(neil)
Comment on attachment 114113 [details] [diff] [review] I would like to think that it's my last patch in this bug I still had to apply the patch manually :-(
Attachment #114113 - Flags: review?(neil) → review+
So... I am given to understand (by hyatt) that <handler>s are recompiled every single time they are called, unlike <method>s which are compiled once per class (not even once per object). THe upshot is that moving code _out_ of handlers may be a good idea. Check with hyatt to verify that, please....
apparently that's right. In nsXBLPrototypeHandler::ExecuteHandler(...) exist a call to CompileEventHandler(...) who make it. But I need <handler>s even if I put methods, for to call them. So I think is the same. Boris, if you want than I post other patch with methods, make a comment then I'll do it. I have one is done.
_if_ I understand this correctly, it's not the same because compiling the JS every time can be a noticeable perf hit.... but again, I don't really know this neck of the woods that well yet; hyatt, neil, and jag are much more familiar with xbl than I am.
I agree with you. but I think that I can't remove the <handler>s, just reduce its content (that's putting in a method).
Attached patch patch with methods (obsolete) — Splinter Review
handler's content in methods
Attachment #114136 - Flags: superreview?(jaggernaut)
Attachment #114136 - Flags: review?(neil)
Of course. All I was saying is it may be worthwhile to make the <handler>s as short as possible.
Or you could just ask hyatt why it's necessary to recompile <handlers> :-P Anyway, what's the perf hit on a mouse click?
Attachment #114014 - Flags: superreview?(jaggernaut)
Attachment #114027 - Flags: superreview?(jaggernaut)
this bug is important to me, because it can change part of my work. (and I want to have a bug patched by me :-)) So I like to see this fixed soon. For that reason I want to turn obsolete one patch. I prefer keep the reviewed+ (for obvious reasons). boris? neil? comments?
Attachment #114136 - Attachment is obsolete: true
Attachment #114136 - Flags: superreview?(jaggernaut)
Attachment #114136 - Flags: review?(neil)
Attachment #114113 - Flags: superreview?(jaggernaut) → superreview?(varga)
sorry, I'm not a superreviewer
Attachment #114113 - Flags: superreview?(varga) → superreview?(jaggernaut)
Comment on attachment 114113 [details] [diff] [review] I would like to think that it's my last patch in this bug varga: ok, thanks, I'm looking for in superreviewers list now...
Attachment #114113 - Flags: superreview?(jaggernaut) → superreview?(ben)
ben doesn't really read bugmail, so if you want his review you'll have to mail him directly.... My comments on the business with obsoleting the patch which should be faster are "eh".
ok, so I turn it to not obsolete, and obsoleting other... :-) I thought that keeping the patch which has reviewed+ would make It close faster... but I was wrong ... :-(
Attachment #114113 - Attachment is obsolete: true
Attachment #114113 - Flags: superreview?(ben)
Attachment #114136 - Attachment is obsolete: false
Attachment #114136 - Flags: superreview?(ben)
Attachment #114136 - Flags: review?(varga)
Ariel, you asked for my opinion. That was my opinion. I'm not the module owner for this code nor a major contributor to it. Neil, Jan, hyatt, Ben are. So you should go with whatever they say.
Attachment #114113 - Attachment is obsolete: false
Attachment #114113 - Flags: superreview?(ben)
Ariel, you asked for my opinion. That was my opinion. I'm not the module owner for this code nor a major contributor to it. Neil, Jan, hyatt, Ben are. So you should go with whatever they say.
:-) my mistake... ok, I did open previous patch, I'll mail Ben for a comment and superreview... thanks Boris, you are a layout superreview, rigth?
Comment on attachment 114136 [details] [diff] [review] patch with methods hmm, this patch seems to be reverse btw, have you tried to use allowevents="true" in your testcase ? I recall that we needed to use this attribute explicitly, why make it default ?
Attachment #114136 - Flags: review?(varga) → review-
Attachment #114136 - Attachment is obsolete: true
Attachment #114136 - Flags: superreview?(ben)
Jan, if I use allowevents="true" in testcase works fine just if I move listbody handler's body to listitem.
Attachment #114113 - Flags: superreview?(ben) → superreview?(bryner)
>Jan, if I use allowevents="true" in testcase works fine that's my point, why don't you use it in your testcase. if there is another problem and you need to move handlers, fine but I don't think allowevents should be default.
Jan, one more question: what is better: I have to move listbody handler's body in listitem, but where: all code in listitem's handler, or, in listitem's methods whick called from listitem's handlers?. Other way to say it: like patch 114113 or like patch 114136? After that, I'll put new patch. thanks :-)
Ariel, I think it's not a big deal. As Neil mentioned it's not perf critical since it's just a click, so I'm ok with <handlers> It should be fixed in XBL core code to not recompile it each time if that's the case.
Jan, that patch is exactly like neil review+, except for allowevents="true" by default. So if you test it don't forget put allowevents="true" in listitem in testcase.
Attachment #114113 - Attachment is obsolete: true
Attachment #114113 - Flags: superreview?(bryner)
Attachment #116313 - Flags: superreview?(bryner)
Attachment #116313 - Flags: review?(varga)
Comment on attachment 116313 [details] [diff] [review] patch with jan's changes looks good r=varga
Attachment #116313 - Flags: review?(varga) → review+
Attachment #116313 - Flags: superreview?(bryner) → superreview?(hewitt)
Attachment #116313 - Flags: superreview?(hewitt) → superreview?(jaggernaut)
Comment on attachment 116313 [details] [diff] [review] patch with jan's changes sr=jag
Attachment #116313 - Flags: superreview?(jaggernaut) → superreview+
checked in, thanks for the patch
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
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.

Attachment

General

Creator:
Created:
Updated:
Size: