7 Replies Latest reply on Nov 18, 2011 5:13 AM by jfb00

    how to add and delete an category from arraycollection by user manually in flex4

    Venkatesan Balasubramanian Level 1

      hi friends,

       

       

      i am doing flex4 mxml web application,i am using one combo box for categeories.and one textbox and one save button.

      and i am having one customize category option,if u click this option a text box will visible .user enter his new categaory name then click save means

      that new category should add with the existing category,my code details are following.

      This is my code

       

      [Bindable]

                  public var expensecategory:ArrayCollection = new ArrayCollection(

                 

                      [ {label:"Entertainment", data:1},

                   {label:"Telephone", data:2},

                   {label:"Travelling Expenses", data:3},

                       {label:"Loans", data:4},

                       {label:"Rent", data:5},

                       {label:"Others", data:6}]);

       

      This datas i am giving by hot coded. now i want give one option for users.

       

      That is customize category option if a user want to add a category food mean he will enter that category name in a text box then click save

      button means it should affect my array collection expensecategory.

       

      How to add,delete,update array collection ?

       

      If a user want to delete an category from this how to delete?

       

       

      I am struck in this.

       

      Looking for useful suggession and snippet code.

       

       

      Cheer,

       

      B.venkatesan