Closed
Bug 269132
Opened 20 years ago
Closed 20 years ago
Implementation of repeat without attribute-based repeats
Categories
(Core Graveyard :: XForms, defect)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: allan, Assigned: allan)
References
Details
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•20 years ago
|
||
Here's a go at repeat. It is implemented by expanding its children with the use
of a pseudo repeatitem element. This is explained in nsXFormsRepeatElement.cpp.
It does not support attribute-based repeats, that's a further step that might
need some support from XTF.
A couple of notes:
* it adds a setContextNode() to nsIXFormsContextControl, so repeat can set
context for its children
* has a GetIntAttr() that probably should go into nsXFormsUtils?
Comments anyone?
Assignee | ||
Updated•20 years ago
|
There needs to be a way to query the current index from the repeat element.
Need this for the XForms XPath extension function index().
When you are cloning the repeat template into repeatitems, any particular reason
that you are calling GetNodeName()? Doesn't look like you do anything with the
result. Handy for debug, though :=)
OnDestroyed - you are setting mElement and mHTMLElement to nsnull. Is there a
reason that you aren't setting mContextNode to nsnull?
GetIntAttr - The logic to do such validation lives in the schema code that Doron
is doing. So after Doron's code is in, GetIntAttr should just get the attr
string and pass it off along with the schema type to his schema code for
validation. No sense duplicating the work. Please get with Doron and make sure
his code that does this will be public and put in a todo comment for GetIntAttr
so that this code will use Doron's code once it is available. Thanks.
Assignee | ||
Comment 3•20 years ago
|
||
(In reply to comment #2)
> There needs to be a way to query the current index from the repeat element.
> Need this for the XForms XPath extension function index().
I do not think you need to query these directly. You will get them as arguments
to Evaluate(). That was the way I was planning to support that. I didn't
acutallu pass that along, but I will include that in the new patch for bug 265216.
> When you are cloning the repeat template into repeatitems, any particular
> reason that you are calling GetNodeName()? Doesn't look like you do
> anything with the result. Handy for debug, though :=)
GetNodeName()? Suddenly I cannot find that anywhere? *ahem* :)
> OnDestroyed - you are setting mElement and mHTMLElement to nsnull. Is there a
> reason that you aren't setting mContextNode to nsnull?
Nope, I'll do that to.
> GetIntAttr - The logic to do such validation lives in the schema code that Doron
> is doing. So after Doron's code is in, GetIntAttr should just get the attr
> string and pass it off along with the schema type to his schema code for
> validation. No sense duplicating the work. Please get with Doron and make sure
> his code that does this will be public and put in a todo comment for GetIntAttr
> so that this code will use Doron's code once it is available. Thanks.
Ah, naturally, yes. I'll put in a todo comment, but is there a bug I can refer to?
Assignee | ||
Comment 4•20 years ago
|
||
Fixed Aaron's comments and also comments on bug 265216, that applied here too.
Attachment #165539 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #165991 -
Flags: review?(bryner)
I think that Doron's making the capability available via his patch to bug 223097
Assignee | ||
Comment 6•20 years ago
|
||
Attachment #165991 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #165991 -
Flags: review?(bryner)
Assignee | ||
Updated•20 years ago
|
Attachment #166739 -
Flags: superreview?(bryner)
Attachment #166739 -
Flags: review?(aaronr)
Assignee | ||
Comment 7•20 years ago
|
||
Attachment #166739 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #166739 -
Flags: superreview?(bryner)
Attachment #166739 -
Flags: review?(aaronr)
Assignee | ||
Updated•20 years ago
|
Attachment #167010 -
Flags: superreview?(bryner)
Attachment #167010 -
Flags: review?(aaronr)
Assignee | ||
Updated•20 years ago
|
Attachment #167010 -
Flags: superreview?(bryner)
Attachment #167010 -
Flags: review?(aaronr)
Assignee | ||
Comment 8•20 years ago
|
||
Something is rotten in the state of Denmark .... found a few bugs, and thus some
more work for next week...
Assignee | ||
Comment 9•20 years ago
|
||
input and output needed to refresh on DocumentChanged() too. If not, they were
never Refresh()'ed when they were finally inserted into the correct document.
But now it should work.
Attachment #167010 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #167330 -
Flags: superreview?(bryner)
Attachment #167330 -
Flags: review?(aaronr)
Updated•20 years ago
|
Attachment #167330 -
Flags: superreview?(bryner) → superreview+
Comment 10•20 years ago
|
||
Comment on attachment 167330 [details] [diff] [review]
Fixed the problem
A couple of minor things.
In nsXFormsOutputElement::ParentChanged, please use same comment that you made
in nsXFormsInputElement::ParentChanged about the context possibly changing.
Something to think about: since repeatitemelement has its own factory, maybe
you should do a little extra checking in case one gets created outside of where
they get created in nsXFormsRepeatElement. Right now you are assuming that
repeat item elements have contextsize and contextposition attrs.
neither of these should hold up checkin, but would be nice to have.
r=me
Attachment #167330 -
Flags: review?(aaronr) → review+
Comment 11•20 years ago
|
||
I offered to check in this patch (to free up bryner). Please post a revised
patch, and I'll see that it gets checked in promptly.
Assignee | ||
Comment 12•20 years ago
|
||
* Added comment in nsXFormsOutputElement
* Set context size and position to 1, if the attributes are not present (or
cannot be converted to an integer)
Attachment #167330 -
Attachment is obsolete: true
Comment 13•20 years ago
|
||
How do you handle the case where someone is modifying the subtree of the
repeat element dynamically? Shouldn't you listen DOMSubtreeModified and
on event call Refresh() or something like that.
Comment 14•20 years ago
|
||
(In reply to comment #13)
> How do you handle the case where someone is modifying the subtree of the
> repeat element dynamically? Shouldn't you listen DOMSubtreeModified and
> on event call Refresh() or something like that.
I'd say treat that as a seperate bug now. Let's get the code in to make
subsequent reviews smaller and spend less time maintaining the patch.
Comment 15•20 years ago
|
||
checked in
Assignee | ||
Updated•20 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•