TileLayout spark Item Renderer and Zoom in and zoom out

I implemented a spark ItemRenderer, which serves a DataGroup with TileLayout:
    <s:Border id="scrollView"
              styleName="scrollView"
              width="100%"
              height="100%">
        <s:filters>
            <s:DropShadowFilter inner="true"
                                alpha=".35"/>
        </s:filters>
        <s:Scroller id="continuousViewScroller"
                    height="100%"
                    width="100%">
            <s:DataGroup id="continuousView"
                         height="100%"
                         width="100%"
                         itemRenderer="PageRenderer"
                         dataProvider="{pages}">
                <s:layout>
                         <s:TileLayout columnAlign.OneUpView="justifyUsingWidth"
                         columnAlign.TwoUpView="left"
                         verticalGap="10"
                         horizontalGap.TwoUpView="10"
                         horizontalAlign="center"
                         verticalAlign="top"
                         useVirtualLayout="true"
                         clipAndEnableScrolling="false"
                         requestedColumnCount.OneUpView="1"
                         requestedColumnCount.TwoUpView="2"/>
                    <!--
                    <s:VerticalLayout horizontalAlign="center"
                                      useVirtualLayout="true"
                                      clipAndEnableScrolling="false"
                                      variableRowHeight="true"
                                      paddingTop="5"
                                      paddingBottom="5"
                                      requestedRowCount="2"/>
                    -->
                </s:layout>
            </s:DataGroup>
        </s:Scroller>
    </s:Border>
I execute a zoom effect everytime some one pushes zoom in or zoom out buttons. The trouble is that zoom in and zoom out works fine. However, the gap between two item renderers increase, when I zoom out.
Is there a way that the gap remains fixed?

Zoom in means, within the PageRenderer, I use a Scale effect, which zooms in and out based on an event. The following code is for doing zoom in and zoom out for the PageRenderer. It works fine. However, the vertical/horizontal gaps increases once have a zoomed in and then try to zoom out incrementally. I want to keep the gap between elements same all the time.
If I run this same code, with VerticalLayout, It works great. However, this does not work with TileLayout.
The following link:
http://opensource.adobe.com/wiki/display/flexsdk/Spark+TileLayout
says:
"Note that justify only grows the columnWidth/rowHeight, so to handle cases where the size of the columns/rows has to shrink, the default column width/row height should set explicitly to zero."
Does anyone has any idea how to implement this?
Source Code for zoom in and zoom out:
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/halo"
                creationComplete="init()">
    <fx:Declarations>
        <s:Scale target="{this}" id="zoomPlayer"  duration="150" />
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import mx.core.FlexGlobals;
            import mx.events.EffectEvent;
            private var _zoom:Number=1.0;
            [Bindable]
            public function set zoom(value:Number):void
                _zoom=value;
            public function get zoom():Number
                return _zoom;
            private function init():void
                var proj:TestProject=FlexGlobals.topLevelApplication as   TestProject;
                proj.systemManager.addEventListener(ZoomEvent.ZoomChange, updateZoom);
            private function updateZoom(event:ZoomEvent):void
                if(zoom != event.zoom){   
                    if(zoomPlayer.isPlaying){
                        zoomPlayer.stop();
                    zoomPlayer.addEventListener(EffectEvent.EFFECT_END, zoomEnd);
                    zoomPlayer.scaleXFrom=zoom;
                    zoomPlayer.scaleXTo=event.zoom;
                    zoomPlayer.scaleYFrom=zoom;
                    zoomPlayer.scaleYTo=event.zoom;
                    zoomPlayer.play();
                    zoom=event.zoom;
            private function zoomEnd(event:EffectEvent):void{
                zoomPlayer.removeEventListener(EffectEvent.EFFECT_END,zoomEnd);

Similar Messages

  • How to make a item renderer have a custom and rounded corners background

    Hi,
    I'm using custom item renderer for items of list. However,
    there is still one thing I haven't made yet. I can't put a
    background with a custom color and with rounded corners.
    How can I do that?
    It seems that all the options I try don't work.
    Can someone give me a tip here?
    Thanks,
    Nuno

    "sinosoidal" <[email protected]> wrote in
    message
    news:gese3u$63n$[email protected]..
    > Hi,
    >
    > I'm using custom item renderer for items of list.
    However, there is still
    > one
    > thing I haven't made yet. I can't put a background with
    a custom color and
    > with
    > rounded corners.
    >
    > How can I do that?
    >
    > It seems that all the options I try don't work.
    >
    > Can someone give me a tip here?
    Check out my extended TileList:
    http://flexdiary.blogspot.com/2008/08/tilelist-with-stylefunction.html
    You might want to swipe the itemRenderer from this example
    and modify it:
    http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html

  • Flex 3 Item renderer in List dissapear and shifted place

    I successfully added ItemRenderer in my List but whenever I scroll down to the bottom and scroll up again. The ItemRenderer in the List would be either gone or shifted places.
    I have search up on possible solution but they doesn't seen like working. I tried to put dataChange=”validateNow()” in the ItemRenderer but it doesn't work. I read something about useVirtualLayout="false" but it seen like my List doesn't have useVirtualLayout ?
    <mx:List
            id="rowsList2" width="{VBoxCall.width}" height="{ scheduleViewerHeight }"
            rowHeight="{ scheduleViewer.rowHeight }"
            verticalScrollPolicy="off" verticalAlign="middle"
             horizontalScrollPolicy="off"
            alternatingItemColors="[0xEEEEEE, 0xDFDFDF]" itemRenderer="RendererState">
            <!-- Example to showcase Item renderer -->
            <mx:dataProvider>
                <mx:Object label="Mr Swabby"
                           data="Juneau"
                           webPage="http://www.state.ak.us/"/>
                <mx:Object label="Mrs Harrington"
                           data="Montgomery"
                           webPage="http://www.alabama.gov/" />
            </mx:dataProvider>
        </mx:List>
    Before (picture) http://i.stack.imgur.com/VxoeP.gif
    After (picture) http://i.stack.imgur.com/3qHO9.gif
    Any Ideas ?
    Regards, Mike

    Hi Alex,
    I've read your blog but I still could find the solution.
    I tried to override the set data but it is not working. Whenever I scroll to the bottom and move up again, all the buttons are gone.
    Please advise me on this.
    Regards,
    Mike
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">   
              <mx:Script>
                        <![CDATA[
                                  // Import Event and URLRequest classes.
                                  import flash.events.Event;
                                  import flash.net.URLRequest;
                                  override public function set data(value:Object):void{
                                            if(value != null)
                                            super.data = value;
                                            if(data.label == null)
                                                      Button.label="";
                                            else
                                                      if(data.label == null || data.label=="")
                                                                Button.label = "";
                                                      else
                                                                Button.label = data.label;
                                            else
                                                      myVBox.removeChild(Button);
                        ]]>
              </mx:Script>
              <mx:VBox id="myVBox">
                        <mx:Button id="Button" width="90">
                        </mx:Button>
              </mx:VBox>
    </mx:VBox>

  • When to use Drop In Item renderer and InLine Item Renderers ??

    Hi ,
    I am getting confused in where to use Inline ItemRenderer and DropIn Item Renderer .
    What i feel is that DROP in Item Renderer are easy to use , and those can satisfy any requirements .
    What i read from tutorilas that we cant use Drop In because they say ,  The only drawback to using  drop in is that them is that you cannot configure them
    Please help me .

    Hi Kiran,
    Here is the detailed explanation you needed:
    You can also refer the link below:
    http://blog.flexdevelopers.com/2009/02/flex-basics-item-renderers.html
    Drop-In Item Renderers
    Drop-In Item Renderers are generic in nature and don't rely on specific data fields to render data. This allows them to be used with a wide range of data sets, hence, the term “drop-in”. Drop-In Item Renderers can be “dropped-in” to any list-based control regardless of the dataprovider’s data properties.
    In our previous example, the employee photo property requires use of a custom Item Renderer to render properly in the UI. In this scenario the Image component satisfies our rendering needs out of the box. Implemented as a Drop-In Item Renderer, the Image component takes any data property regardless of name and uses it as the Image component's source property value. Assuming our employee photo property contains a valid image path, the Image Drop-In Item Renderer will work perfectly and resolve the image path as an image in the UI.
    <!-- Drop-in Item Renderer: Image control -->
    <mx:DataGridColumn dataField="photo"
                       headerText="Employee Photo"
                       itemRenderer="mx.controls.Image"/>
    Drop-In Item Renderers are simple and easy to use and satisfy specific use cases nicely. However, they provide no flexibility whatsoever. If your needs are not satisfied by a Drop-In Item Renderer, you must create your own Item Renderer as an inline component or an external component.
    Inline Item Renderers
    Generally used for simple item rendering requiring minimal customization, inline Item Renderers are defined as a component nested within the MXML of your list-based control.
    It is important to note that Item Renderers nested within the itemrender property of a list-based control occupy a different scope than the list-based control. Any attempt to reference members (properties or methods) of the parent component from the nested Item Renderer component will result in a compile-time error. However, references to the members of the parent component can be achieved by utilizing the outerDocument object.
    <mx:DataGrid id="myGrid" dataProvider="{gridData}">
       <mx:columns>
          <mx:DataGridColumn headerText="Show Relevance">
             <mx:itemRenderer>
                <mx:Component>
                   <mx:Image source="{'assets/images/indicator_' + data.showRelevance + '.png'}"
                             toolTip="{(data.showRelevance == 1) ? 'On' : 'Off'}"
                             click="outerDocument.toggle()" />
                </mx:Component>
             </mx:itemRenderer>
          </mx:DataGridColumn>
       </mx:columns>
    </mx:DataGrid>
    Remember, rules of encapsulation still apply. Mark all properties or methods public if you want them accessible by your inline Item Renderer. In the previous example, the toggle() method must have a public access modifier to expose itself to the inline Item Renderer.
    public function toggle():void
    Inline Item Renderers can also be reusable by creating a named component instance outside of the list-based control. This component must have an id property and contain the rendering logic of the Item Renderer. Using data bindings, the component is assigned to the itemrenderer property of one or more data properties of a list-based control.
    <!-- Reusable inline Item Renderer -->
    <mx:Component id="ImageRenderer">
       <mx:VBox width="100%" height="140"
                horizontalAlign="center" verticalAlign="middle">
          <mx:Image source="{'assets/'+data.image}"/>
          <mx:Label text="{data.image}" />
       </mx:VBox>
    </mx:Component>
    <!-- Used within a list-based control-->
    <mx:DataGridColumn headerText="Image"
                       dataField="image" width="150"
                       itemRenderer="{ImageRenderer}"/>
    In the previous example, note that the Item Renderer component contains 2 UI controls – Image and Label. When using multiple controls within an Item Renderer, a layout container is required. In this example, a VBox was used.
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari
    Message was edited by: BhaskerChari

  • Zoom item renderer out of scroller boundaries

    Hi everyone, hoping someone has the easy Answer.  I want to have an item renderer that can zoomIn and display outside the scroller boundaries for which it resides in. 
    I have
    Scroller  set depth property =1
    |
    Datagroup (tile layout) depth=2
    |
    custom zoomable LabelItemRenderer depth=3  (depth=4 when zooming in so it overlaps the other renderers in the datagroup) ....these tiles, when zoomed, will increase in size by 50%.
    So in other words, the datagroup is wrapped in a scroller, and I extended the LIR to zoom.
    If I take the scroller out of the picture, everything works great...if I zoom on an IR(tile) that is on the very border of the datagroups boundaries, it will display over the DG's boundaries so that the whole zoomed tile is shown.
    Now if I wrap the DG in a scroller, the IRs will zoom, but any tiles on the boundary will get clipped by the boundary, like it is underneath the scroller.
    I want a zoomed tile to display completely, even if that means overlapping the boundaries of the scroller.  Like I said, works great when the DG doesn't have a scroller wrapped around it.
    Is this possible?
    I should add its a 4.6 mobile project.

    I don't use jbuilder
    This is what apears at the commandpromt:
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    java.lang.OutOfMemoryError
            <<no stack trace available>>This is the version of java i use (I use the compiler that comes with it it does not answer to -version itself)
    java version "1.3.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
    Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)This is my ListCell renderers get method:
         public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus)
              String[] ss=((arrayjanus) value).getArray();
              JPanel p=new JPanel();
              p.setLayout(new BoxLayout(p,BoxLayout.X_AXIS));
              for(int i=0;i<lenghts.length;i++)
                   JTextField jt=new JTextField(lenghts);
                   jt.setText(ss[i]);
                   jt.setCaretPosition(0);
                   p.add(jt);
              return p;
    I run in the same problem if i switch of the DB access and on a selection do nothing but System.out.println the count of selections (I get it after ~ 800 clicks in rapid succession under theese circumstances)
    I am having about 50 items in the list.

  • Creating page items from pl/sql procedure and using them on a page

    I have a page containing 2 select lists (P21_DEPARTMENTS and P21_DATE). Originally I added them as items that were "select list with submits". The problem is that based on the clearance level of the currently logged on user I only wanted the P21_DEPARTMENTS to be a select list if the user was an administrator. If however the user is not an admin then I want the page to have a hidden form field called P21_DEPARTMENTS that stores the user's department and has a label item that has the department name.
    There is also a report region that generates a table based on the department selected from the select list (if the user is an admin) or the value stored in the hidden form field if the user is not.
    My problem is that I cannot have both those items on the same page and use the HTML built-in authentication to determine which item should be rendered because I need to use the same ID for both items so that the stored procedure in my report region doesn't break. HTML does not permit items to share the same ID.
    I tried to circumvent the problem by creating a stored procedure that performs all of the item rendering in the procedure and uses "htp.p()" to output all of my HTML code. This solution would allow me to pass a parameter into the procedure informing me as to whether or not the user is an administrator. If the user is an administrator the procedure would use a conditional statement and render a select list. If not, the hidden form field and label option would be used instead.
    I finally got the stored procedure working perfectly. Now I am encountering the most bizarre thing. Since the "select list with submit" was not working (I used the same code that gets generated when I created other items using htmlDB's GUI) I decided to use a JavaScript function instead that gets triggered by the onChange event. I send along the value that is currently selected in the select list and in the function I set:
    location.href='http://www.myoraclesite.com/pls/htmldb/f?p=111:21:729740000000000000::NO::P21_DEPARTMENTS:1';
    In theory this should work. The problem is that it doesn't. The page reloads and the P21_DEPARTMENTS select list is not pre-selected.
    The only thing I can think of is that when htmlDB generates page items that you've created with it's own admin tool it assigns some internal guid or something as opposed to when someone tries to generate dynamic page items of their own from a pl/sql procedure it's like the application doesn't even know they exist.
    Any help would be GREATLY appreciated.
    My only other solution would be to create a totally separate page (one for admin and another for non-admin). I would really like to avoid this.
    Thanks in advance.

    I would love to be able to generate my menus and
    various other items in my htmlDB applications in much
    the same way I can using ASP, PHP and Cold Fusion.
    Users should have the ability to write server-side
    code wherever they feel like it. The way htmlDB works
    right now I spend more time trying to figure out how
    to create simple effects and generate simple
    interfaces when I need to be building a portal. Ami - it's important to understand that HTML DB is not like other languages. Thus, trying to force concepts which are common in other languages into HTML DB will often result in more work.
    It's definitely worth the time to go over the HTML DB 2-day Developer, which can be found here: http://www.oracle.com/technology/products/database/htmldb/pdf/B14377_01.pdf
    I can build a portal using Classic ASP, C#, PHP or Cold
    Fusion in like 1/10 of the time that it takes me to
    build one using htmlDB. I understand that this is not
    meant for the hard-core programmer but no web
    programming application in today's day and age should
    prevent experts from getting under the hood.And I can build a Portal in HTML DB in 1/10 the time it will take me to do it in any other language. It's like anything else - proficiency comes with practice and work.
    As for getting under the hood, there is plenty of places you can do that with HTML DB. Keep in mind that HTML DB itself is an HTML DB application, so the limits on what you can build with HTML DB are virtually limitless.
    Sorry for the vent there. After spending the last 2
    days trying to figure out how to implement such a
    straightforward thing and now being informed that it
    can't be done kind of bugged me.I understand your frustration, as I've been there before. My rule for beginners is that if you are writing more than a line or two of code in the first week, you're doing something wrong. Stop, take a break, and then use the ample resources (including searching this forum) to help solve your problem. There are plenty of resources available for you to learn about HTML DB on the HTML DB home page: http://otn.oracle.com/htmldb
    Good luck,
    - Scott -

  • Datagrid item renderer destroys on mouse over

    Hi,
         I used Flex 3.5 datagrid. I used item renderes in my datagrid. and i set 'rendererIsEditor = true'.
         Everything is very smooth and good. But somtimes my datagrid acting badly. When i put cursor on itemRenderer, It open-up for
    editing. When i move mouse, item renderer destroyed.
         Once it happens it is the default behaviour of my datagrid. No editing can be performed.
          But i can not reproduce it always. sometimes it a happens.
          please help me. anybody know about this?

    Simplify your test case.  Try using a simple TextInput as the renderer and
    see if you have the same problem.

  • Changing List's item renderer and layout causes exception

    I have buttons in my UI to switch a list between a tile view (thumbnails) and a list view (details).
    This code works:
         var layout:TileLayout = new TileLayout();
         resultsList.layout = layout;
         resultsList.itemRenderer = new ClassFactory(MediaTileRenderer);
    This code doesn't:
         var layout:VerticalLayout = new VerticalLayout();
         resultsList.layout = layout;
         resultsList.itemRenderer = new ClassFactory(MediaItemRenderer);
    It's not the item renderer's fault, I can use the tile renderer again in the second block of code and it will still explode.  If I swap the VerticalLayout for a TileLayout, it works fine.  HorizontalLayout explodes.
    The exception is occurring in LinearLayoutVector/remove (541):
    Error: invalidIndex
    at spark.layouts.supportClasses::LinearLayoutVector/remove()[E:\dev\4.x\frameworks\projects\ spark\src\spark\layouts\supportClasses\LinearLayoutVector.as:541]
    at spark.layouts::VerticalLayout/elementRemoved()[E:\dev\4.x\frameworks\projects\spark\src\s park\layouts\VerticalLayout.as:1311]
    at spark.components::DataGroup/http://www.adobe.com/2006/flex/mx/internal::itemRemoved()[E:\dev\4.x\frameworks\projects\s park\src\spark\components\DataGroup.as:1580]
    at spark.components::DataGroup/removeRendererAt()[E:\dev\4.x\frameworks\projects\spark\src\s park\components\DataGroup.as:625]
    at spark.components::DataGroup/removeAllItemRenderers()[E:\dev\4.x\frameworks\projects\spark \src\spark\components\DataGroup.as:642]
    at spark.components::DataGroup/set itemRenderer()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\DataGroup.as:446 ]
    at spark.components::SkinnableDataContainer/set itemRenderer()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\SkinnableDataCon tainer.as:420]
    Does anyone know why this doesn't work?  It seems like a fairly common idea- using a single list and toggling between different view modes.

    Here's a zip of a sample project: http://dl.dropbox.com/u/15760/LayoutTest.zip.
    A workaround that I've found:
    Switch to a BasicLayout while changing the itemRenderer, then apply the VerticalLayout afterwards.

  • Need for a Datagrid with variableRowHeight="true" and custom Item Renderer to display exact rows

    Hi again, developers:
    I'm in a search of a datagrid  with certain characteristics:
         - variableRowHeight = "true"
         - only one column
         - each row must have a custom item renderer with possibly different heights, and a fixed width
         - the datagrid must show always every item in the data provider with no vertical scroll bars, what means that the datagrid height must have always the exact height sum of all the item renderers it is displaying.
         - and no extra empty rows must appear in the last positions of the datagrid
    The last two requirements are something difficult to achieve... for some reason, empty rows appear at the last positions of the datagrid. I post what i've managed to get:
    <mx:Script>
         <![CDATA[
         private function resize():void
                    if (dg.dataProvider)
                        var h:Number = dg.measureHeightOfItems( -1, dg.dataProvider.length);
                        dg.height = h;
         ]]>
    </mx:Script>
    <mx:DataGrid id="dg" width="530" horizontalCenter="0" verticalScrollPolicy="off"
            dataProvider="{dp}"
            wordWrap="true" variableRowHeight="true" showHeaders="false" dataChange="resize()" height="{dg.measureHeightOfItems(-1,dg.dataProvider.length)}" click="Alert.show(dg.rowCount.toString());">
            <mx:columns>
                <mx:DataGridColumn headerText="ID" width="50">
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:TextArea height="{Math.random()*100}" wordWrap="true" backgroundColor="{Math.random() * 16777216}" paddingTop="0" paddingBottom="0"/>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
            </mx:columns>
        </mx:DataGrid>

    Thanks Harui, but it doesn't help. If the border is set it will help, but the very big problem is the empty rows that appear at the end of the datagrid... I can't find a way of measuring correctly the height of the itemRenderers!
    I'll update this thread if I manage to do it.

  • Datagrid and Inline Item renderer problem

    I have a datgrid with two inline item renderers. The dataprovider for my DG is a nested object (objects within objects within objects i.e 3-layered).
    Main Object - 1st Level
                              |
                  2nd Level Object 1
                                    |
                                3rd level object '1' => ('name'=>somename,'id'=>someid)
                                3rd level object '2'
                                3rd level object 'n'
                 2nd Level Object 2
                                    |
                                3rd level object '1' => ('name'=>somename,'id'=>someid)
                                3rd level object '2'
                                3rd level object 'n'
    I use 2 item renderers (one for each datagrid column) which loops thro the 2nd level object1 and 2 respectively (the 2nd level object is a dynamic array of objects, in that the number of objects within keep changing).
    Within the item renderer I loop thro the 2nd level object using a foreach and then display the data. The data is a linkbutton, which when clicked , calls a remote object function to delete the data from the database
    now on the result event of the remote object function call, i call the function to repopulate the DG, so that the updated data is displayed.
    When i click on the linkbutton in the first row, the backend works perfectly fine (the data gets deleted from the database and the refreshed data is sent back), but for some reason, the deleted data suddenly appears in the 2nd row.
    When i delete it from the second row, it appears on the 3rd row (nothing happens in the backend since the data is already deleted).. and so on, till it appears on the last row and then the DG looks exactly the way it shld have looked after the first delete.
    This is just the beginning. The second item renderer also displays a linkbutton, which when clicked, displays that data in the previous column (the one where this data can be deleted). When i click on 1st row, the data gets added in the previous column of the second row .. and so on..
    Basically, my DG is acting really weird. I overrided the set data function in the item renderer to refrsh the data and called its invalidateDisplayList. I also call the Datagrid's invalidateDisplayList function after each refresh.  The behavior remains the same.
    Please help me on this ...

    Hi, Post a test code.... It will be a lot easier to help you Mich

  • Drag and Drop in Item Renderer

    I created an item renderer for use in a TileList. This item
    renderer shows a thumbnail, name, and a few buttons. I want to
    enable drag but only for the image. I know it is easy to enable
    drag for Tile List items as a whole, but how do I do that for just
    part of an item, which was rendered using my custom item renderer?
    Thanks for any help!

    Have you tried to turn off drag for TileList and enable it
    only for the thumbnail? It should work.
    ATTA

  • Datgrid and Item Renderer scrollling problem

    Hello,
    I have a Datgrid containign item rendrer as follows :
    <mx:DataGrid  width="800" id="gridSecondaire" styleName="dataGridStyle" verticalScrollPolicy="off" headerHeight="30" >
              <mx:columns>
                   <mx:DataGridColumn rendererIsEditor="true" 
                                              editorDataField="result"
                                              itemRenderer="com.cdf.intra_cmmi.view.advancedTree.BodyDetailDocumentRenderer" />
              </mx:columns>
         </mx:DataGrid>
    The problem is I when i scroll the datagrid the  rows do not stay in the same position how to solve this please ?

    Here the item Renderer
    ===================ITEM RENDRER==========================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" height="28" width="388" creationComplete="init(event)"  click="clickTexte(event);">
        <mx:Script>
        <![CDATA[
            [Embed(source="images/icon/tree_defaultLeafIcon.png")]
            public static const tree_defaultLeafIcon:Class;
            [Embed(source="images/icon/tree_pptLeafIcon.png")]
            public static const tree_pptLeafIcon:Class;
            [Embed(source="images/icon/tree_xlsLeafIcon.png")]
            public static const tree_xlsLeafIcon:Class;
            [Embed(source="images/icon/anglais.png")]
            private var anglaisIcon:Class;
            import com.sqli.intra_cmmi.constants.ConstantAssets;
            private function clickTexte(event:MouseEvent):void {
                    var fileReference:FileReference = new FileReference();
                    fileReference.download(new URLRequest(data.chemin_document));
            private function init(event:Event):void {
                import com.sqli.intra_cmmi.vo.DocumentVO;
                import mx.controls.Alert;
                import mx.collections.ArrayCollection;
                    var nom_document:String =data.nom_document as String;
                    var description_document:String = data.description_document as String;
                    var language_document:String =data.language_document as String;
                    var ext:String = data.ext as String;
                    var type:String = data.type_document as String;
                    var chemin_document:String = data.chemin_document as String;
                    switch (type)
                            case "Modèle":
                                imageTypeDoc.source = ConstantAssets.modele;
                                break;
                            case "Guide":
                                imageTypeDoc.source = ConstantAssets.guide;
                                break;
                            case "Document":
                                imageTypeDoc.source = ConstantAssets.document;
                                break;
                            case "Outils":
                                imageTypeDoc.source = ConstantAssets.outils;
                                break;
                            case "Check-liste":
                                imageTypeDoc.source = ConstantAssets.checklist;
                                break;
                            default:
                                imageTypeDoc.source = ConstantAssets.document;
                    nom.text=nom_document+' ('+ext+')';
                    if(language_document!='1036'){
                        imageAnglais.source=anglaisIcon;
                    if(description_document!=""){
                        imageDescription.source=anglaisIcon;
        ]]>
    </mx:Script>
        <mx:Image id="imageTypeDoc" x="5" y="5" height="15" width="15"   />
        <mx:Text x="23" y="3" width="326" id="nom"/>
        <mx:Image x="351" y="5" height="15" width="15" id="imageAnglais"/>
        <mx:Image x="370" y="5" height="15" width="15" id="imageDescription"/>
    </mx:Canvas>
    ======================Main.MXLM  (Blue Code part) ===============================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
        width="830"  creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import com.sqli.intra_cmmi.services.MainService;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import com.sqli.intra_cmmi.controller.ProduitController;
                import com.sqli.intra_cmmi.services.VerticalMenuService;
                //import com.sqli.intra_cmmi.services.MainService;
                import com.sqli.intra_cmmi.vo.ProduitVO;
                import mx.controls.Alert;
                public var objectList : Array = new Array();
                public function init():void
                    myProc.listeDomaineProcessus();
                    if(VerticalMenuService.getInstance().produitVerticalMenu.getChildren().length > 0)
                        // On positionne l'accordion des produits sous l'accordion commun
                        VerticalMenuService.getInstance().produitVerticalMenu.y = VerticalMenuService.getInstance().verticalMenu.height - 49;
                        MainService.getInstance().lefter.addChild(VerticalMenuService.getInstance().produitVertic alMenu);
                    var id:String;
                    id=ProduitController.getInstance().currentProduitId;
                    if(id!=null)
                        myProd.getProduitDescription(id);
                        myProd.getDocumentPrincipauxByProduit(id,1);
                        myProd.getDocumentSecondaireByProduit(id,0);
                        myProd.getRolesProduit(id);
                        myProd.getAjustementProduitByID(id);
                private function getDataListener_listeDomaineProcessus(event:ResultEvent):void
                    //refPhase= new ArrayCollection();
                    this.objectList = event.result as Array;
                    // Peupler l'accordion
                    ProduitController.getInstance().populateVerticalMenu(this.objectList);
                private function getDataListener_getDocumentSecondaireByProduit(event:ResultEvent):void
                    var obje:Array = event.result as Array;
                    if(obje.length>0)
                        gridSecondaire.dataProvider = event.result as Array;
                        gridSecondaire.rowHeight = 33;                   
                        gridSecondaire.height = obje.length*33+30;
                        var maximumHeight : int = 228;
                        if ( gridSecondaire.height > maximumHeight){
                          gridSecondaire.verticalScrollPolicy = "on";
                          gridSecondaire.height = maximumHeight;                   
                    else
                        gridSecondaire.visible=false;
                        gridSecondaire.includeInLayout=false;
                override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                    super.updateDisplayList(unscaledWidth, unscaledHeight);
                    // Peupler l'accordion (rafraichissement lors du passage d'une rubrique à une autre)
                    ProduitController.getInstance().populateVerticalMenu(this.objectList);
                private function getDataListener_getProduitDescription(event:ResultEvent):void{
                        description.title=ProduitVO(event.result).nom_produit;
                        idPanelDescription.htmlText=ProduitVO(event.result).description_produit;
                private function faultListener(event:FaultEvent):void {
                        Alert.show(event.fault.message, "Error");
            ]]>
        </mx:Script>
        <mx:VBox verticalGap="20"  horizontalCenter="0" top="10" bottom="10">       
        <mx:Panel width="800" height="121" id="description"  styleName="stylePanel"  >
            <mx:Label paddingLeft="5"  paddingRight="5" paddingTop="40"  width="100%" id="idPanelDescription"/>
        </mx:Panel>
       <mx:DataGrid  width="800" id="gridSecondaire" styleName="dataGridStyle" verticalScrollPolicy="off" headerHeight="30"  >
            <mx:columns>
                <mx:DataGridColumn rendererIsEditor="true"  editorDataField="result"
                 itemRenderer="com.sqli.intra_cmmi.view.advancedTree.BodyDetailDocumentRenderer"
                  headerText="Documents secondaires"/>
                <mx:DataGridColumn rendererIsEditor="true"  editorDataField="result" dataField="livrable_document" headerText="Livrables" width="100"/>    
            </mx:columns>
        </mx:DataGrid>
        </mx:VBox>
        <mx:RemoteObject id="myProc" destination="zend" source="ProcessusService" showBusyCursor="true" fault="faultListener(event)">
            <mx:method name="listeDomaineProcessus" result="getDataListener_listeDomaineProcessus(event);" />
        </mx:RemoteObject>
        <mx:RemoteObject id="myProd" destination="zend" source="ProduitsService" showBusyCursor="true" fault="faultListener(event)">
            <mx:method name="getRolesProduit" result="getDataListener_getRolesProduit(event);" />
            <mx:method name="getDocumentPrincipauxByProduit" result="getDataListener_getDocumentPrincipauxByProduit(event);" />
            <mx:method name="getDocumentSecondaireByProduit" result="getDataListener_getDocumentSecondaireByProduit(event);" />
            <mx:method name="getAjustementProduitByID" result="getDataListener_getAjustementProduit(event);" />
            <mx:method name="getProduitDescription" result="getDataListener_getProduitDescription(event);" />
        </mx:RemoteObject>
    </mx:Canvas>

  • Overriding Spark DataGrid item renderer's prepare method - renderer's child is initially null

    I am currently using the 4.12.0 SDK.  I have a Spark DataGrid setup that makes use of an externally-defined itemRenderer:
    <s:DataGrid id="dgEquipment"
                width="100%" height="100%"
                doubleClickEnabled="true"
                creationComplete="init()" doubleClick="popTab(event)">
      <s:columns>
        <s:ArrayList>
          <s:GridColumn itemRenderer="renderers.equipment.IconRenderer"
                        dataField="EXISTING"
                        width="22"/>
    The data provider is set programmatically after a remote call has returned a result.
    I have the renderer setup as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        dataChange="init()" remove="dispose()">
      <s:layout>
        <s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
      </s:layout>
      <fx:Script>
        <![CDATA[
          import mx.controls.Menu;
          import mx.events.MenuEvent;
          import spark.components.DataGrid;
          [Bindable]
          [Embed(source="../../../assets/images/Icon 1.png")]
          private var ico1:Class;
          [Bindable]
          [Embed(source="../../../assets/images/Icon 2.png")]
          private var ico2:Class;
          [Bindable]
          [Embed(source="../../../assets/images/Icon 3.png")]
          private var ico3:Class;
          private var isExisting:Boolean;
          private var popUp:Menu;
          private function init():void
            if (data)
              isExisting = data.EXISTING == 1;
          private function dispose():void
            if (popUp)
              popUp.removeEventListener(MenuEvent.ITEM_CLICK, popUp_click);
              popUp = null;
            if (imgActions)
              imgActions.removeEventListener(MouseEvent.CLICK, image_click);
              imgActions = null;
          override public function prepare(hasBeenRecycled:Boolean):void
            if (data)
              if ((data.TYPE == "A" || data.TYPE == "B") && !data.X && !data.Y)
                disableLink();
                imgActions.source = ico3;
                imgActions.toolTip = "Blah blah.";
              else if (data.TYPE == "C" || data.TYPE == "D")
                disableLink();
              else if (isExisting)
                imgActions.source = ico1;  //******************************            imgActions.toolTip = "More blah blah.";
                imgActions.addEventListener(MouseEvent.CLICK, image_click);
              else
                imgActions.source = ico2;
                imgActions.addEventListener(MouseEvent.CLICK, image_click);
                imgActions.toolTip = "Even more blah blah.";
                initPopUp();
          private function initPopUp():void
          private function popUp_click(event:MenuEvent):void
          private function image_click(event:MouseEvent):void
          private function disableLink():void
        ]]>
      </fx:Script>
      <s:Image id="imgActions"
               height="18" width="18"/>
    </s:GridItemRenderer>
    When the code reaches the line where I have added a comment full of asterisks, I get the following error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at renderers.equipment::IconRenderer/prepare()[C:\…\renderers\equipment\IconRenderer.mxml:81 ]
        at spark.components.gridClasses::GridViewLayout/initializeItemRenderer()[/Users/justinmclean /Documents/ApacheFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/Gri dViewLayout.as:1808]
        at spark.components.gridClasses::GridViewLayout/createTypicalItemRenderer()[/Users/justinmcl ean/Documents/ApacheFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/ GridViewLayout.as:1243]
        at spark.components.gridClasses::GridViewLayout/updateTypicalCellSizes()[/Users/justinmclean /Documents/ApacheFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/Gri dViewLayout.as:1374]
        at spark.components.gridClasses::GridViewLayout/measure()[/Users/justinmclean/Documents/Apac heFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as: 875]
        at spark.components.supportClasses::GroupBase/measure()[/Users/justinmclean/Documents/Apache Flex4.12.0/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as:1156 ]
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/cor e/UIComponent.as:9038]
        at mx.core::UIComponent/validateSize()[/Users/justinmclean/Documents/ApacheFlex4.12.0/framew orks/projects/framework/src/mx/core/UIComponent.as:8962]
        at spark.components::Group/validateSize()[/Users/justinmclean/Documents/ApacheFlex4.12.0/fra meworks/projects/spark/src/spark/components/Group.as:1074]
        at mx.managers::LayoutManager/validateSize()[/Users/justinmclean/Documents/ApacheFlex4.12.0/ frameworks/projects/framework/src/mx/managers/LayoutManager.as:673]
        at mx.managers::LayoutManager/doPhasedInstantiation()[/Users/justinmclean/Documents/ApacheFl ex4.12.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:824]
        at mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/justinmclean/Documents/ ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1188]
    Running the debugger shows that this occurs with the first item in the data provider.  If I alter the prepare method to check for the existence of imgActions before doing anything, everything works fine after the first item.  So I'll have one row in the DataGrid with a missing icon, and all the rest will have icons.
    So the question is, is it normal for prepare to run before any children of the item renderer are created?  If so, how should I handle this?
    Many thanks in advance.

    A little more info.  I added some event handlers to the renderer and the image (for events that I thought would be relevant), and here is the order of events based on trace statements within the handlers:
    griditemrenderer1_addedHandler
    griditemrenderer1_addedToStageHandler
    griditemrenderer1_preinitializeHandler
    imgActions_addedHandler
    griditemrenderer1_addedHandler
    imgActions_addedToStageHandler
    imgActions_preinitializeHandler
    imgActions_addedHandler
    griditemrenderer1_addedHandler
    imgActions_initializeHandler
    griditemrenderer1_elementAddHandler
    imgActions_addHandler
    griditemrenderer1_initializeHandler
    griditemrenderer1_addHandler
    prepare called
    imgActions_resizeHandler
    griditemrenderer1_resizeHandler
    imgActions_creationCompleteHandler
    imgActions_updateCompleteHandler
    griditemrenderer1_creationCompleteHandler
    griditemrenderer1_updateCompleteHandler
    griditemrenderer1_removeHandler
    griditemrenderer1_addedHandler
    griditemrenderer1_addedToStageHandler
    imgActions_addedToStageHandler
    griditemrenderer1_addHandler
    griditemrenderer1_dataChangeHandlerTypeError: Error #1009: Cannot access a property or method of a null object reference.
    prepare called
        at renderers.equipment::IconRenderer/prepare()[C:\…\renderers\equipment\IconRenderer.mxml:91 ]
    imgActions_renderHandler
    griditemrenderer1_renderHandler

  • Importing my video from my event library into my project library, it shows the full width of the clip, but on the viewing section, it's zoomed in and cut the sides of the video off.  How do I stop this from happening?

    When importing my video from the event library to the project library, it's zooming in and
    narrowing the width of my footage.  How do I stop this from happening?

    In the project, double-click on the clip to open the Clip Inspector. In the Clip tab you will see an item about two thirds down labelled "Stabilization". If checked, uncheck the box "Smooth clip motion".
    Stabilizing clips causes a zoomed in effect, with the extent of the zoom dependent upon how shaky the footage is. There is a slider beneath the check-box labelled "Maximum Zoom" - this can be draggged back and forth to adjust the zoom effect if desired, once the clip has been stabilized.
    You may have chosen to analyze clips for stabilization when importing to iMovie (that's a choice provided by iMovie upon import). If so, it's best to turn off an option in iMovie's preferences. Go to this from the iMovie menu item iMovie>Preferences. Click on the Browser tab and deselect (uncheck) the box labelled "Automatically stabilize clips that have been analyzed".
    I prefer to import clips without analyzing, as this speeds up the import process. Afterwards, in the Event you can check for any overly shaky clips, then analyze them in the Inspector. If necessary, once dropped into a Project, you can stabilize them as desired. You can also stabilize clips directly in the Project without having to first analyze them in the Event.
    John
    Message was edited by: John Cogdell

  • Erratic zooming in and out using drag and drop to copy.

    While using the drag and drop to copy method in AI 18.0(and17) there is erratic zooming in and out behavior.
    I've called Adobe and Apple about this issue and it still remains. I've also tried the Hot Fix download but the problem still remains.
    I'm using an iMac with OS 10.9.4 and the Magic Mouse.
    Please help! Thanks in advance.
    Dennis, DB Signs

    When I click and hold on a selection then drag it holding down the option key to copy it, when I release the mouse where I want it to be copied it zooms in or out(radically) once or several times and usually copies the selected item to a different place then I wanted it to.
    Now I’ve noticed that if I don’t touch the side of the mouse(keeping only one finger on the top of the mouse) I don’t have the issue.
    Thank You, Dennis Burns, DB Signs
    Phone: 320-629-8919
    Fax: 844-269-8172
    Email: [email protected]
    Website: www.dbsigns.biz

Maybe you are looking for

  • Restriction of number of POs for a single Sales Order

    Hi, Currently, For a Single Sales Order multiple Purchase Orders are being created. Now, the Client wants to restrict number of Purchase Orders for a Single Sales Order that means, he wants only 1 Purchase Order for 1 Sales Order. Could you guys sugg

  • AddRequestObject has been deprecated while adding a resouce to a request

    Hi Friends, I have created a schedule task to create a request and to add users to it and also to provision a resource to the user. It is creating a request and adding a user successfully. But while adding resource to the request by using the correct

  • Wake on Lan (works, but not always)

    Iam trying to get Wak on Lan working on my iMac. It works, but not always. When I put my mac to sleep en send the magic package, my mac turns back on. But when my mac turns to sleep and I wait a few hours (the next morning), my Mac doesn't respond to

  • Nested Table having more than 1 column comparison using ORACLE MULTISET

    Dear ALL, I am using ORACLE 10gR2 Database. I am currently trying to compare two sets of data that I get from two queries in PL/SQL. I want to use Oracle MULTISET UNION, MULTISET INTERSECT, MULTISET EXCEP for those operations. But When I am executing

  • Put away to production lines directly, storage location control WM

    We are Using Storagelocation Control Functionality in WM We have below Storage locations RW01 - Raw Material Storing PD01 - Materials staged for Production Lines I have setup 001 as Standard Storage location and 002 as 'not copied to TR' Few material