9 Replies Latest reply on Oct 24, 2011 11:09 AM by Shongrunden

    interactionMode in spark VGroup

    pamai

      Hi all!

       

      Does anyone know if it's posible use interactionMode=touch in a s:VGroup like in a s:DataGrid?  (web application)

       

      It works:

      <s:DataGrid id="aaa"  interactionMode="touch">

       

      It doesn't work:

      <s:VGroup id="aaa" interactionMode="touch" />

       

       

      Thanks!!

        • 1. Re: interactionMode in spark VGroup
          pamai Level 1

          I'm using Flex 4.5.1 SDK and it's for scroll a list of items using touch

          • 2. Re: interactionMode in spark VGroup
            pamai Level 1

            Any idea??

             

            Please...

            • 3. Re: interactionMode in spark VGroup
              Shongrunden Adobe Employee

              Is the VGroup inside a Scroller?  If so you need to set interactionMode="touch" on the Scroller, not the VGroup.

              • 4. Re: interactionMode in spark VGroup
                pamai Level 1

                Thanks!!

                 

                Another question...

                 

                I get an error when I use interactionMode=touch in some component of the application:

                 

                aspectRatio was not found in the project


                at spark.components::Scroller/checkScrollPosition()[E:\dev\4.5.1\frameworks\projects\spark\s rc\spark\components\Scroller.as:1142]

                at spark.components::Scroller/checkScrollPositionsOnUpdateComplete()[E:\dev\4.5.1\frameworks \projects\spark\src\spark\components\Scroller.as:1237]

                at flash.events::EventDispatcher/dispatchEventFunction()

                at flash.events::EventDispatcher/dispatchEvent()

                 

                It works correctly but displays this error.

                Any idea?

                • 5. Re: interactionMode in spark VGroup
                  Shongrunden Adobe Employee

                  Can you please post a small sample application that demonstrates this RTE?

                  • 6. Re: interactionMode in spark VGroup
                    pamai Level 1

                    I get the error using interactionMode="touch" in DataGrid and/or Scroller+VGroup.

                    This is the example with DataGrid:

                     

                     

                    <mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" backgroundColor="#333333"

                                           horizontalScrollPolicy="off" verticalScrollPolicy="off">

                     

                    <fx:Script>

                                        <![CDATA[

                                                  import model.CSensor;

                                                  import mx.collections.ArrayCollection;

                     

                                                  [Bindable]

                                                  public var someSensors:ArrayCollection =  new ArrayCollection();

                     

                                                  public function init():void{

                                                            someSensors = new ArrayCollection();

                                                            roSensor.getSensors();

                                                  }

                     

                                                  public function handleFault(event: Object): void {

                      Alert.show(event.fault.faultCode + "\n" + event.fault.faultString, "Error");

                                                  }

                     

                                                  public function handleResultSensors(event: Object): void {

                                                            someSensors = event.result;

                                                  }

                     

                                        ]]>

                              </fx:Script>

                                   <mx:VBox left="5" top="5" right="5" bottom="5" verticalGap="5">

                                                  <s:DataGrid id="dgr_sensors" dataProvider="{someSensors}" width="100%" height="100%"  verticalScrollPolicy="on"                horizontalScrollPolicy="off" rowHeight="80" interactionMode="touch">

                                                                 <s:columns>

                                                                                <s:ArrayList>

                                                                                               <s:GridColumn dataField="Name" headerText="Name" width="150"/>

                                                                                               <s:GridColumn  dataField="Other" headerText="Other"/>

                                                                                </s:ArrayList>

                                                                 </s:columns>

                                                  </s:DataGrid>

                              </mx:VBox>

                     

                              <fx:Declarations>

                                             <mx:RemoteObject id="roSensor" destination="sensorService" showBusyCursor="true" fault="handleFault(event)">

                                                            <mx:method name="getSensors" result="handleResultSensors(event)" />

                                             </mx:RemoteObject>

                              </fx:Declarations>

                     

                    </mx:Canvas>

                    • 7. Re: interactionMode in spark VGroup
                      Shongrunden Adobe Employee

                      Your code sample doesn't compile for me.  I was unable to reproduce using this complete sample application:

                       

                      <?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">

                          <fx:Script>

                              <![CDATA[

                                  import mx.collections.ArrayCollection;

                       

                                  [Bindable]

                                  public var someSensors:ArrayCollection =  new ArrayCollection([{Name:'steve', Other:'test'},{Name:'steve', Other:'test'},{Name:'steve', Other:'test'}]);

                                 

                              ]]>

                          </fx:Script>

                          <s:DataGrid id="dgr_sensors" dataProvider="{someSensors}" width="100%" height="100%

                                      verticalScrollPolicy="on"          

                                      horizontalScrollPolicy="off" rowHeight="80" interactionMode="touch">

                              <s:columns>

                                  <s:ArrayList>

                                      <s:GridColumn dataField="Name" headerText="Name" width="150"/>

                                      <s:GridColumn  dataField="Other" headerText="Other"/>

                                  </s:ArrayList>

                              </s:columns>

                          </s:DataGrid>

                         

                      </s:Application>

                       


                      Can you please provide a similar complete code example that doesn't work for you?

                      • 8. Re: interactionMode in spark VGroup
                        pamai Level 1

                        This is a sample application:

                         

                         

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

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

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

                                                                xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" horizontalAlign="left" verticalAlign="top" layout="absolute" pageTitle="Example" creationPolicy="all" historyManagementEnabled="false" horizontalScrollPolicy="off" verticalScrollPolicy="off">

                         

                        <fx:Script>

                                            <![CDATA[

                                                      import model.CSensor;

                                                      import mx.collections.ArrayCollection;

                         

                                                      [Bindable]

                                                      public var someSensors:ArrayCollection =  new ArrayCollection();

                         

                                                      public function init():void{

                                                                someSensors = new ArrayCollection();

                                                                roSensor.getSensors();

                                                      }

                         

                                                      public function handleFault(event: Object): void {

                          Alert.show(event.fault.faultCode + "\n" + event.fault.faultString, "Error");

                                                      }

                         

                                                      public function handleResultSensors(event: Object): void {

                                                                someSensors = event.result;

                                                      }

                         

                                            ]]>

                                  </fx:Script>

                                       <mx:VBox left="5" top="5" right="5" bottom="5" verticalGap="5">

                                                      <s:DataGrid id="dgr_sensors" dataProvider="{someSensors}" width="100%" height="100%"  verticalScrollPolicy="on"                horizontalScrollPolicy="off" rowHeight="80" interactionMode="touch">

                                                                     <s:columns>

                                                                                    <s:ArrayList>

                                                                                                   <s:GridColumn dataField="Name" headerText="Name" width="150"/>

                                                                                                   <s:GridColumn  dataField="Other" headerText="Other"/>

                                                                                    </s:ArrayList>

                                                                     </s:columns>

                                                      </s:DataGrid>

                                  </mx:VBox>

                         

                                  <fx:Declarations>

                                                 <mx:RemoteObject id="roSensor" destination="sensorService" showBusyCursor="true" fault="handleFault(event)">

                                                                <mx:method name="getSensors" result="handleResultSensors(event)" />

                                                 </mx:RemoteObject>

                                  </fx:Declarations>

                         

                        </mx:Canvas>

                         

                         

                         

                         

                        Thank you very much!!

                        • 9. Re: interactionMode in spark VGroup
                          Shongrunden Adobe Employee

                          Here is a smaller case that demonstrates this bug:

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

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

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

                           

                              <s:List width="100%" height="100%" interactionMode="touch">

                                  <s:ArrayList>

                                      <fx:String>0</fx:String>

                                      <fx:String>1</fx:String>

                                  </s:ArrayList>

                              </s:List>

                           

                          </mx:Application>

                          It looks like you won't be able to use mx:Application with interactionMode="touch".  Can you use s:Application instead?

                           

                          I've filed a bug for this here: http://bugs.adobe.com/jira/browse/SDK-31937