How can I return data in dataProvider of entering text in listRenderer?

Hi people,

I would like to set up a list that I can add/remove data from. I used a custom listRenederer to set up a list with 3 text entries in each line and fill in the data:

package
{
    import flash.events.Event;
    import flash.events.MouseEvent;

    import qnx.ui.listClasses.AlternatingCellRenderer;
    import qnx.ui.listClasses.CellRenderer;
    import qnx.ui.text.KeyboardType;
    import qnx.ui.text.TextInput;
    import qnx.ui.text.TextInputIconMode;

    public class ColumnCellRendere extends AlternatingCellRenderer
    {
        private var column1:TextInput;
        private var column2:TextInput;
        private var column3:TextInput;

        public function ColumnCellRendere()
        {
            super();
        }

        override protected function init():void
        {
            column1 = new TextInput();
            column1.restrict = "0-9";
            column1.keyboardType = KeyboardType.PHONE;
            column1.clearIconMode = TextInputIconMode.NEVER;
            column1.width = 50;
            addChild(column1);

            column2 = new TextInput();
            column2.restrict = "0-9";
            column2.keyboardType = KeyboardType.PHONE;
            column2.clearIconMode = TextInputIconMode.NEVER;
            column2.width = 50;
            column2.x = 60;
            addChild(column2);

            column3 = new TextInput();
            column3.restrict = "0-9";
            column3.keyboardType = KeyboardType.PHONE;
            column3.clearIconMode = TextInputIconMode.NEVER;
            column3.width = 50;
            column3.x = 120;
            addChild(column3);

            column1.addEventListener(MouseEvent.CLICK, onClick);
            column1.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);

            super.init();
        }

        private function onClick (e:MouseEvent):void
        {
            dispatchEvent(new Event(Event.SELECT, true, true));
        }

        private function onMouseDown (e:MouseEvent):void
        {
            e.stopImmediatePropagation();
        }

        override public function set data(data:Object):void
        {
            super.data = data;

            column1.text = data.col1;
            column2.text = data.col2;
            column3.text = data.col3;
        }

    }
}

I can happily fill the list, but when I want to change the values, I can't have the data to account for the data provider. Similarly, if I add a new line to the list, I end up with empty values in table dataProviders and cannot work out how to get the new data into it. Any help appreciated.

In your 'data' function, maintain a reference to it:

private var _data: Object;

So, in theory, when the data changes, you can

This._data.Col1 = this.column1.text; or what ever.

Will need this code to ensure that it can do what you want.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • continuous reboot of failed reset

    I had a broken screen and has been using the laptop with HDMI to my TV screen.  I tried to reset the original hard drive to get rid of excess software and virus potential because he was slow.  I didn't know that the computer would not automatically r

  • L80 Gigaframge driver for Windows 7

    Hello There is no driver for gigaframe L80 for Windows 7 working as a clone or something else?I also tried looking for a vista driver but I found nothing. Thank you

  • Memory HP OfficeJet 5510

    Hi people, Anyone know how much memory is in an OfficeJet 5510? If this is not the case, can you please tell me how to find out? I can't find the answer in * any * sheets I've read. Thank you! James

  • Array of strings

    This should be an easy question. I try to use the "write to the spreadsheet" VI from Labview 8.0 but I need to change to accept arrays of strings, rather than arrays of doubles. 8.2 does it automatically, but I'm stuck using 8.0. The instructions in

  • Update moved

    I received last week a number of windows updates, installed them except one who is not 18 times in 7 days. It's the "update for windows mail filter mail junk (March 2009) (KB905866). How can I make this? Missing just whether stationary or during the