Last Comment Bug 361094 - copyItem doesn't generate xforms-value-changed
: copyItem doesn't generate xforms-value-changed
Status: RESOLVED FIXED
: fixed1.8.0.12, fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: x86 All
: -- normal (vote)
: ---
Assigned To: aaronr
: Stephen Pride
Mentors:
Depends on:
Blocks: 353738
  Show dependency treegraph
 
Reported: 2006-11-17 17:19 PST by aaronr
Modified: 2016-07-15 14:46 PDT (History)
1 user (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
testcase (2.52 KB, application/xhtml+xml)
2006-11-17 17:21 PST, aaronr
no flags Details
patch (2.80 KB, patch)
2007-03-16 15:16 PDT, aaronr
bugs: review+
surkov.alexander: review+
Details | Diff | Splinter Review
patch2 (3.49 KB, patch)
2007-03-19 09:28 PDT, aaronr
no flags Details | Diff | Splinter Review

Description aaronr 2006-11-17 17:19:24 PST
If a user selects a copyItem from a select or select1, a xforms-value-changed event doesn't not get generated.
Comment 1 aaronr 2006-11-17 17:20:34 PST
(In reply to comment #0)
> If a user selects a copyItem from a select or select1, a xforms-value-changed
> event doesn't not get generated.
> 

Should read 'doesn't get generated' Its my inner redneck trying to break out :-)
Comment 2 aaronr 2006-11-17 17:21:06 PST
Created attachment 245870 [details]
testcase
Comment 3 aaronr 2007-03-15 20:56:25 PDT
One issue is that it shows as out of range and throws an out of range message to begin with.  That is because it is refreshing before the itemset is done creating all of its items.  Probably not related to the value-changed part of the bug, though.
Comment 4 aaronr 2007-03-16 15:16:11 PDT
Created attachment 258850 [details] [diff] [review]
patch

Simple fix was to mark the node as changed during mdg's SetNodeContent, so that the xforms-value-changed event will be dispatched.  I also included fixes for two tinderbox build warnings that we currently have.

The issue of the select1 being initially marked as out of range will need to be fixed in the select/select1 bug -> bug 372197, since it is getting caused by the fact that we now create items due to mutation events.
Comment 5 alexander :surkov 2007-03-19 00:27:54 PDT
Comment on attachment 258850 [details] [diff] [review]
patch


>-    nsresult rv;
>+    nsresult rv = NS_OK;
>     for (PRInt32 i=0; i<mPendingInlineSchemas.Count(); ++i) {
>       GetSchemaElementById(mElement, *mPendingInlineSchemas[i],
>                            getter_AddRefs(el));
>       if (!el) {
>         rv = NS_ERROR_UNEXPECTED;
>       } else {
>         if (!IsDuplicateSchema(el)) {
>           nsCOMPtr<nsISchema> schema;

If IsDuplicateSchema(el) == PR_TRUE then it will throw dublicateSchema error. Don't we need to 
have "schemaLoadError" error additionally (previously it was randomly I guess)? r=me with this answered and fixed if it's needed.
Comment 6 aaronr 2007-03-19 08:38:08 PDT
(In reply to comment #5)
> (From update of attachment 258850 [details] [diff] [review])
> 
> >-    nsresult rv;
> >+    nsresult rv = NS_OK;
> >     for (PRInt32 i=0; i<mPendingInlineSchemas.Count(); ++i) {
> >       GetSchemaElementById(mElement, *mPendingInlineSchemas[i],
> >                            getter_AddRefs(el));
> >       if (!el) {
> >         rv = NS_ERROR_UNEXPECTED;
> >       } else {
> >         if (!IsDuplicateSchema(el)) {
> >           nsCOMPtr<nsISchema> schema;
> 
> If IsDuplicateSchema(el) == PR_TRUE then it will throw dublicateSchema error.
> Don't we need to 
> have "schemaLoadError" error additionally (previously it was randomly I guess)?
> r=me with this answered and fixed if it's needed.
> 

I don't believe so.  Having a duplicate schema defined isn't a fatal error, I don't think.  It isn't spelled out really well in the spec.  The spec just says that it shouldn't happen, not what should occur if it should happen.  We should just ignore the duplicate schema and continue on, I guess.  But of course this could lead to other problems like what if a type MIP is set with a value being a type from this ignored schema?  The other processors (Novell, X-Smiles and formsPlayer) don't seem to do anything at all.  Not even throw an error.  At least we do that much :-)

So I'll check this patch in as is.
Comment 7 alexander :surkov 2007-03-19 08:50:40 PDT
It's fine with me. Though a little comment won't be disadvantage :).
Comment 8 aaronr 2007-03-19 09:28:18 PDT
Created attachment 259006 [details] [diff] [review]
patch2

patch for checkin.  Added comment about duplicate schema.
Comment 9 aaronr 2007-03-19 09:34:55 PDT
checked into trunk
Comment 10 aaronr 2007-04-23 16:26:56 PDT
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16

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