2 Replies Latest reply on May 19, 2011 4:23 AM by snkd

    immutable/mutable object

    snkd Level 1

      I have collection of Freservation Object in ArrayCollection.those are bind to customized-combobox call txtRefNo, and _acDataProvider is the dataprovider property name._nSelectedIndex is SelectedIndex property name.

       

      My problem is when I change the freservation object,It is reflecting that value into ArrayCollection also(original object).I don't need to do that.I ant to avoid it.

      Any Ideas?

      Is that mean object is mutable?if yes how can I convert it to immutable object.

       

              <valueObjects:Freservation id="freservation "/>

       

                  protected function onSelectReservation(event:Event):void
                  {

                      freservation =new Freservation();
                      freservation =txtRefNo._acDataProvider.getItemAt(txtRefNo._nSelectedIndex) as Freservation;

                     }

       

      its like for normal combo box

       

                  protected function onSelectReservation(event:Event):void
                   {

                      freservation =new Freservation();
                       freservation =txtRefNo.dataProvider.getItemAt(txtRefNo.selectedIndex) as Freservation;

                    }