4 Replies Latest reply on Jul 19, 2007 9:32 AM by Newsgroup_User

    comboBox event

    Level 7
      Hi All,
      How can I fire "change" event for a comboBox in programming?
      I try this without luck

      var e:event = new event("change")
      myComboBox.dispatchEvent(e);

      Thank you
      JFB


        • 1. Re: comboBox event
          ntsiii Level 3
          I'd just pull the code in the handler out into its own function and call that. Your theory looks sound though. I assume "new event" is a typo, should be "new Event"

          Events are complex.

          Tracy
          • 2. Re: comboBox event
            Level 7
            Thank you Tracy,
            If I replace "change" for "Change" actualy works :)
            Can you try this in your end?
            Also, I'm adding a new row to my datagrid, I can't find the way to focus the
            cursor in the first column editable cell.
            Do you know how?
            Rgds

            JFB

            "ntsiii" <tspratt@lariatinc.com> wrote in message
            news:f76mnb$hd5$1@forums.macromedia.com...
            > I'd just pull the code in the handler out into its own function and call
            > that. Your theory looks sound though. I assume "new event" is a typo,
            > should be "new Event"
            >
            > Events are complex.
            >
            > Tracy


            • 3. Re: comboBox event
              ntsiii Level 3
              That should be a new thread, but look into the "editedItemPosition" property.

              You might need to do that work using callLater(), after you add the new row, so that the dg has a chance to render the new row before yu try to manipulate it.. Try it first without.

              Tarcy
              • 4. Re: comboBox event
                Level 7
                I'm trying to pass my dataGrid name on the function but I got an error:
                Implicit coercion of a value of type void to an unrelated type Function.
                Why? any ideas?

                callLater(focusNewRow(gpdDataGrid)); --->>> Error here
                }

                public function focusNewRow(myDataGrid:DataGrid):void{
                myDataGrid.editedItemPosition = {
                columnIndex:0,rowIndex:myDataGrid.dataProvider.length-1
                };
                }

                Tks
                JFB


                "ntsiii" <tspratt@lariatinc.com> wrote in message
                news:f78v09$d23$1@forums.macromedia.com...
                > That should be a new thread, but look into the "editedItemPosition"
                > property.
                >
                > You might need to do that work using callLater(), after you add the new
                > row,
                > so that the dg has a chance to render the new row before yu try to
                > manipulate
                > it.. Try it first without.
                >
                > Tarcy
                >