4 Replies Latest reply on Jan 15, 2008 3:58 AM by vij010

    List Control


      Just a quick check...how do you add rows to a list control...I am testing out a small thing where I have a text input field and the contents of that field goes into a list component. I am able to get the text inside, but not on a new row....the update happens on the same row itself.....something like....


        • 1. Re: List Control
          atta707 Level 2
          1) make sure the array collection that serving as dataProvider for this list is marked as [Bindable]
          2) call the addItem() method on this array collection when you want to add a new item to the list

          the newly added item in the array collection would appear automatically in your list.

          • 2. Re: List Control
            vij010 Level 1
            I get what you mean, but I don't have an array collection here, becuase I am just taking the text input's data and feeding that to the list. I have a text input field and one button, when the code fires on this button, the update on the list happens that's all.

            Does this mean I have to first create the array collection , have the textinput push it's items to the array and then take it from there ?...Isn't too many steps ?
            • 3. Re: List Control
              atta707 Level 2
              what's the data provider for the list currently?

              Yes. This may look like too many steps, but that how you separate your view from model in MVC pattern.

              • 4. Re: List Control
                vij010 Level 1

                The data provider for this is a text input field in which I type some stuff. That stuff gets into the list box...