cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: [WOODY] - How to bind a repeater from other widget (or add filled in repeaters from another source )
Date Fri, 02 Apr 2004 00:03:11 GMT
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message