cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew <andrewm...@gmail.com>
Subject checkbox widget with datatype vector
Date Sat, 22 Jul 2006 14:24:36 GMT
Hi,
I have a shopping cart system which enables a user to select a number of
items from their cart and delete them at the same time. This was working
perfectly before I chnaged everything to widgets because I need to use ajax.
What is happening now is that no matter how many items you select to delete,
only one item is ever deleted at a time. Now I suspect that the problem lays
with the datatype being used in fd:

    <fd:field id="delItem" required="true|false">
      <fd:datatype base="string"/> // I tried boolean and nothing was being
deleted
    </fd:field>

widget definition is:

     <ft:widget id= "delItem">
        <fi:styling value="${orderitem.getID()}" type="checkbox"/>
     </ft:widget>

flow:

        delItems = bizData.delItem;
        var items = new java.util.Vector();

        if (parseInt(bizData.quantity) || delItems != null) {
            try {

                if (delItems != null) {

                   if (delItems.iterator) { // A list of delItems have been
selected to be deleted.
                      items.addAll(delItems);
                      deleteOrderItem2(items);
                   } else { //A single delItem has been selected to be
deleted.
                      items.add(delItems);
                      deleteOrderItem2(items);
                   }
                }

Any ideas what I am missing here?

regards

Andrew

Mime
View raw message