You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johnson <jo...@soho.club.tw> on 2004/06/19 03:03:14 UTC

how to call widget event from other place

Hi!

I define a repeater widget with an event in it

    <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 = new Packages.java.math.BigDecimal("0");

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

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

    </fd:repeater-action>

I want to define a on-value-changed event in amt widget
when the amt is changed , it trigle the event in removeDaily,how to?

Best Regards

Johnson


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org