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

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
12 years ago
a year ago

People

(Reporter: Stephen Pride, Assigned: Doron Rosenberg (IBM))

Tracking

({fixed1.8.0.2, fixed1.8.1})

Trunk
fixed1.8.0.2, fixed1.8.1
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(4 attachments, 3 obsolete attachments)

(Reporter)

Description

12 years ago
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
(Reporter)

Comment 1

12 years ago
Created attachment 187833 [details]
testcase
(Reporter)

Comment 2

12 years ago
Created attachment 187836 [details]
testcase

Correct testcase - previous one had wrong xforms namespace prefix.

Updated

12 years ago
Attachment #187833 - Attachment is obsolete: true

Comment 3

12 years ago
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
(Assignee)

Updated

12 years ago
Blocks: 300801

Updated

12 years ago
Blocks: 278448
(Assignee)

Comment 4

12 years ago
Created attachment 199847 [details] [diff] [review]
le patch
Assignee: aaronr → doronr
Status: NEW → ASSIGNED
Attachment #199847 - Flags: review?(aaronr)
(Assignee)

Comment 5

12 years ago
Not sure where to put this in the select1 code

Comment 6

12 years ago
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-

Comment 7

12 years ago
Created attachment 199878 [details]
aaron's testcase

Comment 8

12 years ago
Created attachment 199881 [details]
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.

Updated

12 years ago
Attachment #199878 - Attachment is obsolete: true
(Assignee)

Comment 9

12 years ago
Created attachment 199965 [details] [diff] [review]
fixes non-incremental select

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
(Assignee)

Updated

12 years ago
Attachment #199965 - Flags: review?(aaronr)

Comment 10

12 years ago
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+

Comment 11

12 years ago
(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.
(Assignee)

Comment 12

12 years ago
Created attachment 200915 [details] [diff] [review]
select1 patch
Attachment #200915 - Flags: review?(smaug)
(Assignee)

Updated

12 years ago
Attachment #199965 - Flags: review?(smaug)

Comment 13

12 years ago
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+

Updated

12 years ago
Attachment #200915 - Flags: review?(smaug) → review+
(Assignee)

Updated

12 years ago
Attachment #200915 - Flags: review?(aaronr)

Updated

12 years ago
Attachment #200915 - Flags: review?(aaronr) → review+
(Assignee)

Comment 14

12 years ago
checked into trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch

Comment 15

12 years ago
needs to stay open until it is on the branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 16

12 years ago
its not goona be in 1.8 branch

Comment 17

12 years ago
probly wont be anymore checkins for branch

Comment 18

12 years ago
checked into MOZILLA_1_8_BRANCH via bug 323691.  Leaving open for now until it gets into 1.8.0

Updated

12 years ago
Whiteboard: xf-to-branch

Updated

12 years ago
Status: REOPENED → RESOLVED
Last Resolved: 12 years ago12 years ago
Keywords: fixed1.8.0.2
Resolution: --- → FIXED

Comment 19

11 years ago
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.