Rajendra Prasad Murakonda wrote:
I am populating a tree from a memory datasource(using
datasources="rdf:null").  Starting point for the tree template  is my
sequence in the RDF. From the tree, I am adding and deleting the nodes in
the RDF. I

When I am adding nodes to the RDF, I check whether the sequence is already
present, if not, then create it(using MakeSeq) and then append the
element(using AppendElement). If the sequence is already present, then
initialize it(with Init).

I can add/delete nodes from the tree with out a problem. If I delete all the
nodes, then there's a problem. If I delete all nodes, close the (tree)
window and open it again to add a node, first note that I add will not be
added. It throws an exception. And then onwards it works fine.

The exception:

[Exception... "Component returned failure code:0x8000ffff
(NS_ERROR_UNEXPECTED)
[nsIRDFContainer.AppendElement]" nsresult:"0x8000ffff
(NS_ERROR_UNCEXPECTED)"
location: "JS frame :: /path/to/jsfile.js :: addNode :: line 296" data: no]

But If I delete all nodes, and then add a new note immediately without
closing the (tree) window, it works fine. What's the problem? Any Ideas?

You get an exception while calling nsIRDFContainer.AppendElement, but if you have removed all nodes, which node do you append the new node to ?

I presume you kept the root node (the one with a RDF id set in the ref attribute, "urn:root" for instance).

When you removed your nodes, presumably with nsIRDFContainer.RemoveElement, did you set the second argument (renumber) to true ?

/mig


_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to