4 Replies Latest reply on May 27, 2010 7:44 AM by TanweerHq

    valueCommit not called for DropDownList

    JockMahon Level 1

      Is there any reason why the function is not been called, this works if the drop down is a dtagrid instead

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo">
          <fx:Script>
              <![CDATA[
                  import mx.controls.Alert;
                  import mx.events.FlexEvent;
                 
                  protected function supplierDopDown_valueCommitHandler(event:FlexEvent):void
                  {
                      Alert.show("Hitting here");
                  }

       

              ]]>
          </fx:Script>
         
          <fx:Declarations>
              <s:ArrayCollection id="g">
                  <fx:Object name="asd"/>
                  <fx:Object name="zxc"/>
                  <fx:Object name="qwe"/>
                 
              </s:ArrayCollection>
          </fx:Declarations>

       


              <s:DropDownList id="supplierDopDown"
                              dataProvider="{g}"
                              valueCommit="supplierDopDown_valueCommitHandler(event)"
                              labelField="name"
                              width="127"
                              fontWeight="normal"/>       
             
      </s:Application>

        • 1. Re: valueCommit not called for DropDownList
          Flex harUI Adobe Employee

          The rules on valueCommit were inconsistent in mx components.  Spark uses

          them more consistently but differently.  What action are you taking to try

          to get valueCommit to fire?  It should only fire for programmatic changes.

          1 person found this helpful
          • 2. Re: valueCommit not called for DropDownList
            JockMahon Level 1

            well in this example i expected it to trigger , as it does for ComboBox, when the componet is created and its dataprovider is set

            • 3. Re: valueCommit not called for DropDownList
              Lead.Bi

              I am seeing problems with programmatic change to fire valueCommit as well.. It works fine in Flex 3.

               

              Thanks,

              Lead

              • 4. Re: valueCommit not called for DropDownList
                TanweerHq Level 2

                Try this code. Click on button after selecting value in Dropdownlist.

                 

                 

                <?xml version="1.0" encoding="utf-8"?>

                 

                <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                 

                               xmlns:s="library://ns.adobe.com/flex/spark"

                 

                               xmlns:mx="library://ns.adobe.com/flex/halo">

                 

                    <fx:Script>

                 

                        <![CDATA[

                 

                            import mx.controls.Alert;

                 

                            import mx.events.FlexEvent;

                 

                 

                 

                            protected function supplierDopDown_valueCommitHandler(event:FlexEvent):void

                 

                            {

                 

                                Alert.show("Yes Hitting here");

                 

                            }

                 

                        ]]>

                 

                    </fx:Script>

                 

                   

                 

                    <fx:Declarations>

                 

                        <s:ArrayCollection id="g">

                 

                            <fx:Object name="asd"/>

                 

                            <fx:Object name="zxc"/>

                 

                            <fx:Object name="qwe"/>

                 

                        </s:ArrayCollection>

                 

                    </fx:Declarations>

                 

                   

                 

                    <s:DropDownList id="supplierDopDown"

                 

                                    dataProvider="{g}"

                 

                                    valueCommit="supplierDopDown_valueCommitHandler(event)"

                 

                                    labelField="name"

                 

                                    width="127"

                 

                                    fontWeight="normal" dropShadowVisible="true"/>  

                 

                   

                 

                    <s:Button x="247" y="247" label="Button" click="{g.addItem('New value' as Object)}"/>

                 

                   

                 

                   

                 

                </s:Application>