to claculate a total-price for a small shoping cart and am 
> trying to figure out how to do this. There are two possible ways I 
> thought about:
> 1. I put some <jx:set name="total" value="${total + 
> productTotalWidgetValue}"/> somewhere inside the repeater itself.
> 2. I have some sort of <jx:forEach ...> stuff that iteratas through all 
> Items outside the repeater.
> 
> Unfortunately I couldn't get any help from the examples, so I need some 
> help :)
> 
> Thanks in advance,
>     Chris
> 

Hi Christofer,

have a look in the dynamicrepeater.xml example.

Maybe something like the following:

<fd:output id="totalPriceProducts">
   <fd:label>Gesamtpreis aller Produkte:</fd:label>
   <fd:datatype base="string"/>
</fd:output>

<fd:repeater-action id="addpage" command="add-row" repeater="pages">
      <fd:label>Seite hinzuf�gen</fd:label>
      <fd:on-action>
        <fd:javascript>
          // Increment the row creation ID counter (it has been
initialized in
          // the flowscript when the form was created).
          // This shows how attributes can be used as a communication
means between
          // application logic and widget event handlers.
          var form = event.source.form;
          var count = new
java.lang.Integer(form.getAttribute("counter").intValue() + 1);
          var totalPriceCart = form.getChild("totalPriceProducts");
          var repeater = form.getChild("pages");

          var priceProduct=repeater.getRow(repeater.getSize() -
1).getChild("numberCount").getValue(count);
           totalPriceCart=totalPriceCart+priceProduct;
         form.setChild("totalPriceProducts");
        </fd:javascript>
      </fd:on-action>
    </fd:repeater-action>

You would need to change pages to your repeater ID. I hope you got the
idea.

HTH

salu2

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

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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

Reply via email to