Closed Bug 279516 Opened 20 years ago Closed 20 years ago

controls not initialized with MIP's

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: allan)

References

Details

Attachments

(2 files, 5 obsolete files)

Changing instance values updates controls accordingly to reflect Model Item
Properties, but controls are not initialized with the MIP's.  During XForms
document initialization, all of the MIP's are given during
nsXFormsMDGEngine::Recalculate and will be distributed to controls during model
revalidation, but all of that happens before form controls are constructed and
bound.  Sounds like maybe we need to send xforms-recalculate to the models right
before or after xforms-ready?  Or look for a way for control to set its own
attributes during refresh?
Attached file testcase that shows the problem (obsolete) —
in this testcaes, when the document is loaded, the pushbutton should either be
hidden or disabled (depending on how we handle relevant="false()").  Right now
it is fully visable and enabled.
Whatever the solution ends up being, we need to keep in mind this note from
4.3.5 in the spec:

"Prior to the dispatching of the xforms-ready event handler, there are no form
controls bound to instance data, so xforms-valid and other notification events
are not dispatched."  So if we do a xforms-recalculate, it needs to be after
xforms-ready.  For what it is worth, fP does that (sends a recalc after ready).
 But Novell plugin doesn't send any event after xforms-ready and right now we
match that lead.
Correct. Somewhat hidden, but I've had that as a todo for some time:
http://lxr.mozilla.org/seamonkey/source/extensions/xforms/nsXFormsModelElement.h#69
Attached patch Patch (obsolete) — Splinter Review
Fixes the problem (and a typo in nsXFormsNodeState)
Assignee: aaronr → allan
Status: NEW → ASSIGNED
Attachment #172875 - Flags: review?(smaug)
Forgot to remove todo comment
Attachment #172206 - Attachment is obsolete: true
Attachment #172876 - Flags: review?(smaug)
Attachment #172875 - Attachment is obsolete: true
Attachment #172875 - Flags: review?(smaug)
Comment on attachment 172876 [details] [diff] [review]
Also removes obsolete todo comment

Looks ok, but could you still make sure that the 
event target is right in nsXFormsControlStub::HandleDefault
Something like this:
  nsCOMPtr<nsIDOMEventTarget> target;
  aEvent->GetTarget(getter_AddRefs(target));
  nsCOMPtr<nsIDOMElement> te(do_QueryInterface(target));
  if (te && te != mElement) {
    *aHandled = PR_FALSE;
    return NS_OK;
  }

Or maybe there could a helper function
PRBool nsXFormsUtils::EqualsTarget(nsIDOMEvent* aEvent, nsIDOMNode* aNode);

Both are ok.
r=me
Attachment #172876 - Flags: review?(smaug) → review+
Attached patch w/smaug's comments (obsolete) — Splinter Review
Attachment #172876 - Attachment is obsolete: true
Attachment #172899 - Flags: superreview?(bryner)
Comment on attachment 172899 [details] [diff] [review]
w/smaug's comments

New patch on the way, that fixes bug 280553 too.
Attachment #172899 - Flags: superreview?(bryner)
*** Bug 280553 has been marked as a duplicate of this bug. ***
Attached patch Ahem, a refresh() too (obsolete) — Splinter Review
1) The controls, logically, needed a refresh() too.

2) The initialization now happens between xforms-model-construct-done and
xforms-ready, which is more correct.

xforms-ready is still not standard-compliant though.
Attachment #172899 - Attachment is obsolete: true
Attachment #172999 - Flags: superreview?(bryner)
*** Bug 280565 has been marked as a duplicate of this bug. ***
*** Bug 280267 has been marked as a duplicate of this bug. ***
Attachment #172999 - Flags: superreview?(bryner) → superreview+
sr, nice, but with the informations -- or rather lack of same -- coming from you
... should I check it in?
:( some of the previous checks-ins break this....
This one is up to date with CVS, and fixes a slip in bug 279957, where
ProcessBindElements() were called twice.
Attachment #172999 - Attachment is obsolete: true
The latest patch is check in ready, but you are not keeping me informed about
what to do about the beta.
sorry for the miscommunication.  I just checked it in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
ConstructDone signature has a problem on Windows.  This will fix it.
Attachment #173091 - Flags: review?(doronr)
Attachment #173091 - Flags: review?(doronr) → review+
checked in the bustage fix.
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: