On 01.04.2004 12:41, JD Daniels wrote:

Yes, Mark is closer... :)

Sorry, this time I think I got it. :)


So I want to make the widgets in the repeater that is being created have these values. Ie, the description will be filled in for the user.

row.description.value = document.getOwnerDocument().getTagName("description");
(This obviously does not work for me :)


Heres my flow on AddRow function as it is now:

model.inventory.onAddRow = function(row) {
var uri = "cocoon:/nde-load-InventoryItem?id=" + model.inventoryId.value;
var resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);


var source = resolver.resolveURI(uri);
var parser = cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
var document = parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil.getInputSource(source));

First let's make this easier:


var pipelineUtil =
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
var document = pipelineUtil.processToDOM(
                                 "cocoon:/nde-load-InventoryItem?id=" +
                                  model.inventoryId.value, null);

//row.description.value = document.getOwnerDocument().getTagName("description");

What part of it exactly returns null? With document you are already at the document root, no need to call getOwnerDocument(). And you must go to <item> first, before selecting description. And what is getTagName()?


Shouldn't you use getLastChild() or (to make it more robust) iterate over the child nodes and test on their node name. Is tag name DOM standard?

document.getFirstChild().getLastChild();

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to