I am developing a product catalog and shopping cart
model and view, where the user can add a product to the
card and delete an item from the cart. The model looks like this.

<order-desk>
   <products>
       <product>
           <product-id>64</product-id>
           <product-name>Software 1.x, Annual Lease</product-name>
           <unit-price>0.20</unit-price>
       </product>
       <product>
           <product-id>65</product-id>
           <product-name>Software 1.x, Annual Support</product-name>
           <unit-price>0.50</unit-price>
       </product>
   </products>
   <cart-items>
       <cart-item>
           <product/>
           <thru-date/>
           <entitlement-key/>
           <product-name/>
           <unit-price/>
       </cart-item>
   </cart-items>
</order-desk>

In the view, the code that creates a new cart-item, looks like this.

<table> <!-- table of products ->
<xforms:repeat nodeset="products/product" id="prodset">
<!-- product fields -->
<tr><td><xforms:output.../></td></tr>
<tr><td><xforms:output.../></td></tr>
...
<tr><td> <xforms:submit>
<xforms:label>Add To Order</xforms:label>
<xforms:insert
nodeset="/order-desk/cart-items/cart-item"
at="last()" position="after"/>
<xforms:setvalue
ref="/order-desk/cart-items/cart-item[last()]/product-id"
value="/order-desk/products/product[index('prodset')]/product-id"/>
<xforms:setvalue
ref="/order-desk/cart-items/cart-item[last()]/product-name"
value="/order-desk/products/product[index('prodset')]/product-name"/>
<xforms:setvalue
ref="/order-desk/cart-items/cart-item[last()]/unit-price"
value="/order-desk/products/product[index('prodset')]/unit-price"/>
</xforms:submit>
</td></tr></xforms:repeat></table>


Problem
------- When the submit is performed the first time, it works as
expected. A new cart-item is appended to the model, its fields
are plugged with values from the product row containing the submit
element, and a row showing the new cart-item is added to the
cart items table.

When the submit is perfomed the second time, a dialog saying
'The document contains no data' pops up, and no new row is created.

I've seen this bug before, but it went away when I booted tomcat,
re-deployed, and rebooted again. This time, that is not working.

Previously, when it worked, I was only updating one field (product-id)
with setvalue. My most recent change was to add updates for two more
fields, product-name and unit-price

Questions
--------
1. What empty document is the pop up most probably referring to ?
2. If this is not a legit approach, what would be another way to achieve
  the same thing, i.e. building cart items from selected product items.

--
Bill Winspur
Manager, Wynnon Systems Inc
Mobile: 403-519-5889



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to