Last Comment Bug 299273 - xforms-select and xforms-deselect events not firing for selects
: xforms-select and xforms-deselect events not firing for selects
Status: RESOLVED FIXED
: fixed1.8.0.2, fixed1.8.1
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Doron Rosenberg (IBM)
: Stephen Pride
Mentors:
http://www.w3.org/TR/xforms/slice4.ht...
Depends on: 281668
Blocks: 278448 300801
  Show dependency treegraph
 
Reported: 2005-06-30 10:46 PDT by Stephen Pride
Modified: 2016-07-15 14:46 PDT (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
testcase (1.33 KB, application/xhtml+xml)
2005-06-30 10:47 PDT, Stephen Pride
no flags Details
testcase (1.33 KB, application/xhtml+xml)
2005-06-30 10:52 PDT, Stephen Pride
no flags Details
le patch (4.48 KB, patch)
2005-10-17 14:07 PDT, Doron Rosenberg (IBM)
aaronr: review-
Details | Diff | Splinter Review
aaron's testcase (4.71 KB, application/xhtml+xml)
2005-10-17 18:49 PDT, aaronr
no flags Details
aaron's testcase II (5.54 KB, application/xhtml+xml)
2005-10-17 19:13 PDT, aaronr
no flags Details
fixes non-incremental select (9.17 KB, patch)
2005-10-18 12:27 PDT, Doron Rosenberg (IBM)
aaronr: review+
bugs: review+
Details | Diff | Splinter Review
select1 patch (6.05 KB, patch)
2005-10-26 14:05 PDT, Doron Rosenberg (IBM)
bugs: review+
aaronr: review+
Details | Diff | Splinter Review

Description Stephen Pride 2005-06-30 10:46:08 PDT
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
Comment 1 Stephen Pride 2005-06-30 10:47:20 PDT
Created attachment 187833 [details]
testcase
Comment 2 Stephen Pride 2005-06-30 10:52:23 PDT
Created attachment 187836 [details]
testcase

Correct testcase - previous one had wrong xforms namespace prefix.
Comment 3 Allan Beaufour 2005-07-14 06:25:52 PDT
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?
Comment 4 Doron Rosenberg (IBM) 2005-10-17 14:07:36 PDT
Created attachment 199847 [details] [diff] [review]
le patch
Comment 5 Doron Rosenberg (IBM) 2005-10-17 14:10:52 PDT
Not sure where to put this in the select1 code
Comment 6 aaronr 2005-10-17 18:47:48 PDT
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.
Comment 7 aaronr 2005-10-17 18:49:29 PDT
Created attachment 199878 [details]
aaron's testcase
Comment 8 aaronr 2005-10-17 19:13:42 PDT
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.
Comment 9 Doron Rosenberg (IBM) 2005-10-18 12:27:09 PDT
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.
Comment 10 aaronr 2005-10-25 14:30:04 PDT
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.
Comment 11 aaronr 2005-10-25 14:32:12 PDT
(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.
Comment 12 Doron Rosenberg (IBM) 2005-10-26 14:05:00 PDT
Created attachment 200915 [details] [diff] [review]
select1 patch
Comment 13 Olli Pettay [:smaug] 2005-10-27 10:38:44 PDT
Comment on attachment 199965 [details] [diff] [review]
fixes non-incremental select

Same comments what Aaron had. Though, not sure what to do with dispatchSelectEvent.
Comment 14 Doron Rosenberg (IBM) 2005-10-28 08:33:07 PDT
checked into trunk
Comment 15 aaronr 2005-10-28 16:17:33 PDT
needs to stay open until it is on the branch
Comment 16 gabe 2005-10-28 17:04:07 PDT
its not goona be in 1.8 branch
Comment 17 gabe 2005-10-28 17:05:08 PDT
probly wont be anymore checkins for branch
Comment 18 aaronr 2006-02-02 17:14:53 PST
checked into MOZILLA_1_8_BRANCH via bug 323691.  Leaving open for now until it gets into 1.8.0
Comment 19 aaronr 2006-07-07 11:32:30 PDT
verfied fixed on MOZILLA_1_8_BRANCH

Note You need to log in before you can comment on or make changes to this bug.