Closed Bug 299273 Opened 16 years ago Closed 15 years ago

xforms-select and xforms-deselect events not firing for selects

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stpride, Assigned: doronr)

References

()

Details

(Keywords: fixed1.8.0.2, fixed1.8.1)

Attachments

(4 files, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050509 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050509 Firefox/1.0.4

The xforms-select and xforms-deselect events are not firing.

Reproducible: Always
Attached file testcase (obsolete) —
Attached file testcase
Correct testcase - previous one had wrong xforms namespace prefix.
Attachment #187833 - Attachment is obsolete: true
Yes, select's do not dispatch these yet. For select1 this depends on bug 281668.

Should we XBL'ize select too, or implement the support in the current code?
Status: UNCONFIRMED → NEW
Depends on: 281668
Ever confirmed: true
Summary: xforms-select and xforms-deselect events not firing → xforms-select and xforms-deselect events not firing for selects
Blocks: 300801
Blocks: 278448
Attached patch le patch (obsolete) — Splinter Review
Assignee: aaronr → doronr
Status: NEW → ASSIGNED
Attachment #199847 - Flags: review?(aaronr)
Not sure where to put this in the select1 code
Comment on attachment 199847 [details] [diff] [review]
le patch

check out the testcase I'm about to attach.  Assuming I'm right, your patch
doesn't process it right.  I believe that in @incremental="false", we should
still do the xforms-select and xforms-deselect and not wait for the blur. 
Also, this doesn't seem to be remembering the initial selection state.	If an
item is pre-selected and then I deselect it, no event.
Attachment #199847 - Flags: review?(aaronr) → review-
Attached file aaron's testcase (obsolete) —
Attached file aaron's testcase II
added an input element to make sure that changing the value via another control
gave the right event sequence.	Sent a note off to Novell to see if my testcase
is right, but I think it is.
Attachment #199878 - Attachment is obsolete: true
Note that the testcase is "invalid" - alerts cause an alert, which will steal
focus and cause the value-changed of the select to happen.
Attachment #199847 - Attachment is obsolete: true
Attachment #199965 - Flags: review?(aaronr)
Comment on attachment 199965 [details] [diff] [review]
fixes non-incremental select

>Index: extensions/xforms/resources/content/select.xml
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/xforms/resources/content/select.xml,v
>retrieving revision 1.3
>diff -w -u -1 -0 -r1.3 select.xml
>--- extensions/xforms/resources/content/select.xml	5 Oct 2005 16:17:48 -0000	1.3
>+++ extensions/xforms/resources/content/select.xml	18 Oct 2005 19:25:27 -0000
                options[i].control.QueryInterface(Components.interfaces.nsIXFormsSelectChild).value;
>+
>+              // if it wasn't selected before add to the list of newly selected items
>+              if (!options[i].wasSelected) {
>+                newSelectedControls.push(options[i].control);
>+              }
>+
>+              options[i].wasSelected = true;
>+            } else {
>+              // it was selected before, but now unselected
>+              if (options[i].wasSelected) {
>+                this.dispatchSelectEvent(options[i].control, "xforms-deselect")
>             }
>+
>+              options[i].wasSelected = false;
>+            }
>+          }

nit: Please fix curly braces alignment problem.
Attachment #199965 - Flags: review?(aaronr) → review+
(In reply to comment #10)
> (From update of attachment 199965 [details] [diff] [review] [edit])
> >Index: extensions/xforms/resources/content/select.xml
> >===================================================================
> >RCS file: /cvsroot/mozilla/extensions/xforms/resources/content/select.xml,v
> >retrieving revision 1.3
> >diff -w -u -1 -0 -r1.3 select.xml
> >--- extensions/xforms/resources/content/select.xml	5 Oct 2005 16:17:48 -0000	1.3
> >+++ extensions/xforms/resources/content/select.xml	18 Oct 2005 19:25:27 -0000
>                
> options[i].control.QueryInterface(Components.interfaces.nsIXFormsSelectChild).value;
> >+
> >+              // if it wasn't selected before add to the list of newly selected items
> >+              if (!options[i].wasSelected) {
> >+                newSelectedControls.push(options[i].control);
> >+              }
> >+
> >+              options[i].wasSelected = true;
> >+            } else {
> >+              // it was selected before, but now unselected
> >+              if (options[i].wasSelected) {
> >+                this.dispatchSelectEvent(options[i].control, "xforms-deselect")
> >             }
> >+
> >+              options[i].wasSelected = false;
> >+            }
> >+          }
> 
> nit: Please fix curly braces alignment problem.
> 


Also be nice if you could figure out a way to keep dispatchSelectEvent common between select and select1.
Attached patch select1 patchSplinter Review
Attachment #200915 - Flags: review?(smaug)
Attachment #199965 - Flags: review?(smaug)
Comment on attachment 199965 [details] [diff] [review]
fixes non-incremental select

Same comments what Aaron had. Though, not sure what to do with dispatchSelectEvent.
Attachment #199965 - Flags: review?(smaug) → review+
Attachment #200915 - Flags: review?(smaug) → review+
Attachment #200915 - Flags: review?(aaronr)
Attachment #200915 - Flags: review?(aaronr) → review+
checked into trunk
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
needs to stay open until it is on the branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
its not goona be in 1.8 branch
probly wont be anymore checkins for branch
checked into MOZILLA_1_8_BRANCH via bug 323691.  Leaving open for now until it gets into 1.8.0
Whiteboard: xf-to-branch
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Keywords: fixed1.8.0.2
Resolution: --- → FIXED
verfied fixed on MOZILLA_1_8_BRANCH
Keywords: fixed1.8.1
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.