cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JD Daniels ...@datatrio.com>
Subject Re: [WOODY] - How to bind a repeater from other widget (or add filled in repeaters from another source )
Date Thu, 01 Apr 2004 17:24:40 GMT
Joerg Heinicke wrote:

> 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);
>
OMG thanks this way cooler :)


>>        //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()?
>
Sorry.. The full Line is:
org.mozilla.javascript.EvaluatorException: 
"file:/usr/tomcat/hosts/components/ROOT/modules/inventory/flow/inventory.js", 
line 138: Cannot convert null to an object.

getTagName()?? No Idea. found it hopping thru Java Docs in an attempt to 
throw something at it that would work.

I am dom Illiterate :)

        row.description.value =document.getFirstChild().getLastChild();
Results in [ #text ]

So it looks like i just need some help using the DOM object :)

> 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();





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message