Closed Bug 297808 Opened 20 years ago Closed 19 years ago

<output> data not updating

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stpride, Assigned: aaronr)

References

()

Details

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050615 Firefox/1.0+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050615 Firefox/1.0+

Sorry if the summary is vague - I'll try to explain.

Go to the URL above using Mozila w/XForms.  Click on the "Stock order form (for
other XForms browsers)" link.  You should get a popup followed by another popup.
 A Stock order example page should then apear.  Enter a stock symbol (it doesn't
matter what).  Once focus is lost for the input control, an xforms-value-changed
event is fired which causes a submission to a remote web site to get some data.
 The data should come back and populate the <xf:output> controls.  In the status
bar of the browser, it shows data is being transferred to the remote site.

If the same is done using IE with formsPlayer and clicking on the example "Stock
order form (for formsPlayer)", the output is displayed properly.

Reproducible: Always

Actual Results:  
No data is displayed after a stock symbol is entered and focus is lost on the
input control.

Expected Results:  
User should the stock symbol information displayed after a stock symbol is
entered and focus is lost on the input control.
The problem here is that instance replacement isn't working right.  This form
does a submission with instance replacement and the output is bound to this
instance so that when the data is returned, the output should be updated with
the result.  However our instance replacement only replaces instance in the
first instance document rather than the proper nodeset in the proper instance
document.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file testcase
This is a simplified testcase.	If you click on the first trigger, let the
submission return and then click on the second trigger, you should see an
updated instance document with an IBM stock quote.
Attached patch first attempt (obsolete) — Splinter Review
pretty simple fix.  Just find the instance element that holds the data this
submission is bound to and replace its document with the document we got from
the submission.
Attachment #186455 - Flags: review?(allan)
Attachment #186455 - Flags: review?(doronr)
Comment on attachment 186455 [details] [diff] [review]
first attempt

looks fine
Attachment #186455 - Flags: review?(doronr) → review+
Comment on attachment 186455 [details] [diff] [review]
first attempt

>+  nsresult rv = GetSelectedInstanceData(getter_AddRefs(data));
>+  if (NS_SUCCEEDED(rv)) {

Why do we rebuild, etc. if GetSelectedInstanceData() fails?

>+    nsCOMPtr<nsIDOMNode> instanceNode;
>+    rv = nsXFormsUtils::GetInstanceNodeForData(data, model, getter_AddRefs(instanceNode));

Split line.

>+    NS_ENSURE_SUCCESS(rv, rv);
> 
>-  instance->SetDocument(newDoc);
>+    nsCOMPtr<nsIInstanceElementPrivate> instanceElement = 

Kill the whitespace at end of the line.

With a good answer to the first question, you have an r=me, but not before.
Attached patch second attemptSplinter Review
I can't remember why I still refreshed, etc. if I couldn't find the instance to
replace.  So moved that logic inside the test for the instance document.
Attachment #186455 - Attachment is obsolete: true
Attachment #187475 - Flags: review?(allan)
Attachment #186455 - Flags: review?(allan)
Comment on attachment 187475 [details] [diff] [review]
second attempt

Allan must be out on vacation.	Smaug?
Attachment #187475 - Flags: review?(allan) → review?(smaug)
turns out that this patch doesn't work because of the bug fixed by 299283.  Once
299283 is in, this patch will work.
Depends on: 299283
Attachment #187475 - Flags: review?(smaug) → review+
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: