On 01.04.2004 12:41, JD Daniels wrote:OMG thanks this way cooler :)
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);
Sorry.. The full Line is://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()?
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
