Yes, Mark is closer... :)

What I am Trying to do (And I have indeed started trying out V2)

I have one widget that *is* a selection list.
id and value are displayed. i have no problems with this.

Select List:
<select>
    <option value="1">First Item</option>
    <option value="2">Second Item</option>
    <option value="3">Third Item</option>
</select>

Now beside it I have an action widget that adds a new repeater. the new repeater has 4 or 5 fields.

In the addrow function, I load up an xml file using the value of the selection list. I want to populate the repeater row with the information in this xml file. So if they have 2 selected, i will load up

<item>
   <name>Second Item</item>
   <rate>23.00</rate>
   <description>Blah Blah</description>
</item>

This is in a document = parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil.getInputSource(source));

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


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


   model.removeinventory.onClick = function() {
       model.inventory.removeRow(function(row) {return row.select.value});
   }


JD


Mark Lundquist wrote:


On Mar 31, 2004, at 3:03 PM, Joerg Heinicke wrote:


I think you only need a dynamic selection list.

http://wiki.cocoondev.org/Wiki.jsp?page=WoodyDatatypeReference

<wd:selection-list src="cocoon:/mychoices.xml" dynamic="true"/>


It looks to me like that's not what JD wants to do (changing the selection-list items); rather, he wants to have the user pull down the menu, and when she lets go, a new row is added based on some information from the select control.

I would do that in the flowscript, something like this:

var wid = form.getWidget();
.
.
wid.thingTypeSelect.onChange =
function () {
model.addSelection (wid.thingTypeSelect.value); // whatever that has to do...
form.load(model); // re-bind
}


I should mention that you need to be using the v2 Woody API in order to do it this way...

~mark


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





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



Reply via email to