0 Replies Latest reply on May 22, 2008 7:13 AM by EvolvedDSM

    First item from form to filtered datagrid not displaying immediately

    EvolvedDSM Level 2
      In my main application, I've got two components: One is a datagrid and the other is a form. The datagrid has a filterFunction on it's dataprovider to only show table records that match today's date. The form inserts the provided fields to my db table, which should then populate within the datagrid immediately after submission. The problem occurs on the first form submission of the day when there are no results in the datagrid to begin with since it's a new day. After submitting the first item, the datagrid remains empty. However on my next form submission, the datagrid populates properly, displaying both my first and second form submissions.

      If I take the filter away and delete the records in the table as to simulate an empty table (as the filtered tables begins at the start of the day), my first form submission will display in the datagrid immediately without having to add an additional record.

      Here's my insert item code:
      private var ds:DataService;
      [Bindable]
      private var entries:ArrayCollection;
      [Bindable]
      private var entry:recepLog; // recepLog is my .as file that contains all my table fields
      // populateRecep method is called at creation complete
      private function populateRecep():void{
      entries = new ArrayCollection;
      ds = new DataService("recepds");
      ds.fill(entries);
      }
      // createEntry() is called when the submit button is clicked
      private function createEntry():void{
      entry = new recepLog;
      var currentDateTime:Date = new Date();
      entry.clientName = clientNameInput.text;
      entry.caseWorker = caseWorkerInput.text;
      entry.actionRequired = actionRequiredInput.text;
      entry.dateToday = dateDisplay.format(currentDateTime);
      ds.createItem(entry);
      resetForm();
      }
      // resetForm() is called from createEntry method
      private function resetForm():void{
      clientNameInput.text = '';
      caseWorkerInput.text = '';
      actionRequiredInput.text = '';
      }

      Notes: this application uses FDS with a coldfusion backend.

      As said, the datagrid is only having trouble on the first submission of the day, but then works great after additional entries. Any help is appreciated.