Hi

 I try to caculate the widget value in repeter to another widget,the code is

     <fd:field id="test">
       <fd:label><i18n:text key="test">test:</i18n:text></fd:label>
       <fd:datatype base="decimal"/>
     </fd:field>

     <fd:repeater id="daily1List">
       <fd:field id="amt">
         <fd:label><i18n:text key="amt">amt:</i18n:text></fd:label>
         <fd:datatype base="decimal"/>
       </fd:field>
     </fd:repeater>

     <fd:repeater-action id="removeDaily1" action-command="delete-rows"
 repeater="daily1List" select="select">
           <fd:label><i18n:text
 key="removeDaily1">removeDaily1:</i18n:text></fd:label>
          <fd:on-activate>
          <javascript>
           var dList =  event.source.parent.lookupWidget("daily1List");
           var testv=0;

           for (var i = 0; i &lt; dList.size; i++) {
                 var row = dList.getRow(i);
                 num1 = row.lookupWidget("amt").value;
                 testv = testv + num1;
         }

         var test = event.source.parent.lookupWidget("test");
         test.setValue(testv);
        </javascript>
       </fd:on-activate>

     </fd:repeater-action>

 If I had two row,one amt is 1,one amt is 2,the test will be "12",why.

 Best Regards

 Johnson



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

Reply via email to