Closed Bug 313858 Opened 19 years ago Closed 8 years ago

Dynamically created model does not work

Categories

(Core Graveyard :: XForms, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: surkov, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b5) Gecko/20051006 Firefox/1.4.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b5) Gecko/20051006 Firefox/1.4.1

When I create model dynamically then xforms controls aren't binded to model. It becomes apparent when xforms controls hasn't extra adattributes witch should appear when controls are binded (f.x. type, read-only etc).

Reproducible: Always
Attached file test case
Summary: dynamically created model isn't work → Dynamically created model does not work
Well, I'm not sure that it is the model failing.
* the controls might try to bind before the model exists
* the instance element is created, but the children are added afterwards. Do we handle that?

But it is not working, that's right. But we haven't focused too much on the dynamics.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #2)
> Well, I'm not sure that it is the model failing.
> * the controls might try to bind before the model exists

My testcase has a button to add new xforms control. Added controls are not binded too.
It looks like when I create model dynamically then nsXFormsModelElement::DoneAddingChildren() is not called threafore the present bug is like bug 308106. I guess when bug 312743 will be fixed then it will be fixed too.
(In reply to comment #4)
I guess when bug 312743 will be fixed then it will be
> fixed too.
> 

No, I think I was wrong. The mentioned bug is about xul documents.
smaug, if bug 308106 assigned to you and thease bug are similar at first sight then maybe do you take a look at it ;)?
I don't know a lot about XTF. I have a question. When I create dynamically element by using createElement() then should a couple beginAddingChildren/doneAddingChildren be called? If it should then I guess nsDocument::CreateElement() should call thease methods and new bug for xtf component should be filed. If it shouldn't then nsXFormsModelElement::InitializeInstances() method should be called in other place (not in DoneAddingChildren() method).
(In reply to comment #7)
> I don't know a lot about XTF. I have a question. When I create dynamically
> element by using createElement() then should a couple
> beginAddingChildren/doneAddingChildren be called? If it should then I guess
> nsDocument::CreateElement() should call thease methods and new bug for xtf
> component should be filed. If it shouldn't then
> nsXFormsModelElement::InitializeInstances() method should be called in other
> place (not in DoneAddingChildren() method).
> 
begin/doneAddingChildren are called only by content sinks - so during parsing
the document. See http://lxr.mozilla.org/seamonkey/source/content/xtf/public/nsIXTFElement.idl#148

The problem with dynamic models it that it is not specified anywhere
when to dispatch xforms-model-construct etc. events.


Blocks: 323593
Severity: normal → enhancement
Assignee: aaronr → xforms
RIP xforms
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: