Extend a component that extends already a spark list ItemRenderer

Hi all

I have the following situation: Im showing lists of very similar data objects (they extend the same parent) so to avoid many many itemrenderers changes (if I need to change something in common properties) when displaying of these data, I've defined a list of spark ItemRenderer (in MXML) that displays common properties (file called BaseRenderer.mxml):

< s:ItemRenderer >

in the Scripting section I override the property data set

some MXML, checkboxes, labels etc.

< / s:ItemRenderer >

Then, I created a specific itemrenderer which extended it (file SpecificRenderer.mxml):

< model: BaseRenderer >

Yet once I override the property data set

some labels ADITIONAL MXML, checkboxes, etc.

< / template: BaseRenderer >

When I run the application, and the specific rendering engine is used, it works (no errors are thrown), but it shows that the content of the specific rendering engine, nothing base converter is visible. What is the right way to do it, or do I have to replace some extra stuff in my specific converters?

Thank you.

One last thing, I just noticed, if I delete all the specific rendering MXML tags, basic converter content becomes visible, that it seems as if a specific content replaces content base. Is it possible to add mxml tags in the specificrenderer?

Yes I suspected them to be merged, and you gave me a good idea. As you say this behavior is worth between all components defined mxml, not only itemrenderers. I want to avoid actionscript converters because I don't (and used) have problems of performance anyway and I like the flexibility in design mode, to remedy this, I found another solution that I slightly modified. Some spark components inherit the mxmlContent property, which you can override. That's what I came up with in the end: I added the override of the property in the specific renderer and everything is shown as expected (because the basic elements are merged with those of the extended component).

override public function set mxmlContent(value:Array):void {}

var added: Boolean = true;

var int index = 0;

so that {(addition)

var element: IVisualElement = null;

try {element = super.getElementAt (index) ;} catch(e:Error) {}

If (element! = null) {}

value.push (element);

index += 1;

}

on the other

Add = false;

}

value. Reverse();

super.mxmlContent = value;

}

Tags: Flex

Similar Questions

  • need help with change in spark list itemRenderer

    Hey guys... so I have a spark list, where I've made available to tileLayout and I use the converter component to display an image and two buttons in each tile... what im trying to do is when you hover over each tile I want buttons fade in and out... and by default... I need to no visible buttons...

    I had pimples fade in and out when you hover over the point... but the problem is that I have when I initialize the application buttons are all visible... If there is no sence...

    any help is greatly appretiated!

    Here is the code I have... can you tell me what changes I need to make...

    <s:List id="searchResultImages" borderVisible="false" dataProvider="{searchImages}" width="100%" height="100%">
         <s:layout>
              <s:TileLayout requestedColumnCount="6" horizontalGap="30" columnWidth="100" rowHeight="85" />
         </s:layout>
         <s:itemRenderer>
              <fx:Component>
                   <s:ItemRenderer>
                        <s:states>
                             <s:State name="hovered" />
                             <s:State name="normal" />
                        </s:states>
                        <s:transitions>
                             <s:Transition fromState="normal" toState="hovered">
                                  <s:Fade id="hoveredFade" targets="{[delBtn, editBtn]}" alphaFrom="0.0" alphaTo="1.0" duration="1000" />
                             </s:Transition>
                             <s:Transition fromState="hovered" toState="normal">
                                  <s:Fade id="normalFade" targets="{[delBtn, editBtn]}" alphaFrom="1.0" alphaTo="0.0" duration="1000" />
                             </s:Transition>
                        </s:transitions>
                        <s:VGroup>
                             <mx:Image source="{data.fileLoc}" width="100" height="50" useHandCursor="true" buttonMode="true" verticalCenter="0" />
                             <s:HGroup>
                                  <mx:LinkButton id="delBtn" label="DEL" skin="{null}" color="#0184C7" rollOverColor="#333333" useHandCursor="true" 
                                                    buttonMode="true" />
                                  <mx:LinkButton id="editBtn" label="EDIT" skin="{null}" color="#0184C7" rollOverColor="#333333" useHandCursor="true" 
                                                    buttonMode="true" />
                             </s:HGroup>
                        </s:VGroup>
                   </s:ItemRenderer>
              </fx:Component>
         </s:itemRenderer>
    </s:List>
    

    Hello

    With a lot of intelligence are already integrated into state transitions, when for example the transition fading knows when to fade in or fade out, get your components placed in the States you want is all that is necessary.

    This is a simple example, but as you can see there is almost no code involved...

    http://gumbo.flashhub.NET/Cyber/ source included

    David.

  • Spark list ItemRenderer 'data' is null.

    I use the same code in one place that I use in another, and still the event creationComplete that they prepare in the itemRenderer, the first line of code, trace("data") returns "null".

    This code has been fine for months of work and suddenly stopped working with no explanation.  I lost two days within period of fixation which should not be broken and I'm no closer to a solution.  Very frustrated. Any help appreciated - greatly.

    Puddleglum.

    = Component relevant code containing spark list = Output from the console displayed in the form of comments

    [Bindable]

    public var itemArray:ArrayCollection = new ArrayCollection();

    [Bindable]

    private var gap: uint = 6;

    private var file:File;

    private var fileStream:FileStream;

    private var toolXML:XML;

    protected function creationCompleteHandler (): void

    {

    trace ("FUNCTION MyLibraryToolsPanel creationCompleteHandler()");

    file = parentApplication.getFileOperations () .getToolFilepath ();

    trace ("file:" + file.url);

    }

    private void loadTool(xmlFilepath:File,_xmlFilename:String):void

    {

    trace ("MyLibraryToolsPanel FUNCTION loadTool ("+ xmlFilepath.url +"," + xmlFilename + ")"); / / MyLibraryToolsPanel FUNCTION loadTool (app-storage: / Tools/User000000, 000000Tool1371827886983.xml)

    var xmlFile:File = xmlFilepath.resolvePath (xmlFilename);

    If (xmlFile.Exists)

    {

    fileStream = new FileStream();

    fileStream.open (xmlFile, FileMode.READ);

    toolXML = XML (fileStream.readUTFBytes (fileStream.bytesAvailable));

    fileStream.close ();

    var obj:Object = new Object();

    obj.xmlFilepath = xmlFilepath;

    obj.xmlFilename = xmlFilename;

    obj.XML = toolXML;

    trace ("obj:" + obj); / / obj: [object Object]

    trace ("FUNCTION MyLibraryToolsPanel loadTool\n"+obj.xml.toXMLString ());   / / returns the XML when uncommented

    itemArray.addItemAt (obj, itemArray.length);

    }

    on the other

    {

    trace ("MyLibraryToolsPanel FUNCTION loadTool XMLFILE does NOT EXIST");  / / This will trigger never

    }

    < s:List id = "itemList".

    useVirtualLayout = "false".

    Changing = "listChangingHandler (Event)" "

    Click = "Event.stopPropagation (); »

    touchTap = "event.stopPropagation (); »

    scrollSnappingMode = "tip".

    Height = "height of {}.

    interactionMode = 'touch '.

    explicitHeight = "{height}".

    dropEnabled = "false".

    dragEnabled = "false".

    dragMoveEnabled = "false".

    allowMultipleSelection = "false".

    alternatingItemColors = "[0xe6e6fa, 0xF0F8ff].

    dataProvider = "{itemArray}.

    itemRenderer = "converters. MyLibraryToolsPanelListItemRenderer ".

    horizontalScrollPolicy = "off".

    verticalScrollPolicy = "on".

    borderVisible = "false".

    visible = "{ItemArray.Length > 0} '"

    includeInLayout = "{itemList.visible}" "

    Width = "100%" >

    < s:layout >

    < s:VerticalLayout id = "itemListVerticalLayout" variableRowHeight = "false" gap = "0" / >

    < / s:layout >

    < / s:List >

    < s:Label id = "noToolsMsg" text = "no tool saved available." horizontalCenter = "0" verticalAlign = "middle" red = "0" visible = "{itemArray.length == 0} ' includeInLayout ="{noToolsMsg.visible}"/ >"

    < / s:Group >

    = Renderer code that contains relevant sections =.

    protected function creationCompleteHandler (): void

    {

    trace ("FUNCTION MyLibraryToolsPanelListItemRenderer creationCompleteHandler"); / / MyLibraryToolsPanelListItemRenderer FUNCTION creationCompleteHandler

    trace ("data:" + data);  / / data: null

    dataProxy = new ObjectProxy (data);

    ...

    Looks like I'll change to use instead of the creationComplete dataChange in all my custom converters.  I can't believe I lost 2 days and more hair because of something so trivial as multithreading.

    Really... You cannot MAKE something before that data is passed and the rendering engine is INSTANTIATED ONLY when an element is added to the dataProvider... Then... the procedure.   Data added to dataProvider-online Insantiate WITH object relevant-Online Layout/rendering/upgrade to day-online THEN creationComplete();   Duh.  creationComplete is a misnomer if you don't even have the relevant data that you use to CREATE the instance.

    No doubt this would be avoided if the BUG that places the dummy rendering engine IN the dataProvider have been set, but as it is - not, been resolved, I have no choice but to disable put in virtual.   Sage, grumble, winge winge winge-grouse.

  • return data to spark list itemrenderer

    Everyone is not how to return data from the itemrender for a spark list. say I had a checkbx in my itemrenderer how can we retrieve this info to my component principal if his selected or not. I looked on the datagrid itemeditor but I really use rather a spark list. Thank you

    Hello

    itemRenderer should be used only as RENDERER. All chenges must be made in the data.

    So if there is a check box, you must add click eventListener and change the property in the data to see whether he is selected.

  • Spark list component Icon property?

    in Flex 3.x the VBox property was property of the icon that you can use to set the images in the elements of the list as well as the label property. How can I get the same thing in a Flex 4 spark list component?

    I would like something like 'iconField' property set to the list item, so that my itemrenderer can be generic and not worry for a specific type of object is passed in.

    Thank you!

    ~ Mike

    I have the subclass would list, add an iconField property and change the default

    renderer a converter custom will check data [iconField] for a

    icon and display it.

  • Update settings prevented the second office "an account with that name already exists...". »

    My provider has modernized and forces me to change the server settings. I did this successfully on a desktop computer and now I want to do this on the second and the third office where I want my accounts available e-mail.

    When I try, I get a window of the wizard account saying "an account with that name already exists. Please enter a different account name. "And I'm prevented from doing the settings made on the second Desktop server.

    How do I get around this?

    Thank you,
    DJBrewster

    Open the configuration editor and search for entries with this name

    There should be two entries with mail.server.serverXX.name (where XX is a number.) change on them and try and change the setting again.

  • How can I get Firefox looking for my computer for the plugins that are already there?

    How can I get Firefox looking for my computer for the plugins that are already there?

    Adobe Flash player is already on my computer from IE 8. How can I get Firefox to see that it is already on my PC and use it so I don't have to download it again and possibly create other problems. Also, in my efforts to download Flash, active Firefox IE that made me concerned that would cause problems that our just leave me where I am now, instance where IE can use a bottle but Firefox cannot.

    Internet Explorer uses a version of the Flash player ActiveX plugin as it does not work with other browsers.

    Download the version of the https://www.adobe.com/products/flashplayer/distribution3.html Plugin-based browsers and make sure Firefox is closed when you install it.

  • Firefox tells me to update Adobe Reader and after I try to do Adobe said that I already have the latest version.

    Firefox shows that my Adobe Reader software must be updated to version 11.0.84 and when I try to update Adobe Reader, it tells me that I already have.

    I also did an update of Firefox and I still have the same problem. I use Windows XP SP3. I don't know what to do. Thank you. Please tell me what I should do next.

    Thank you.

    Adobe only offers versions of basic as a full download.
    If there is a newer version then you must always run the update of the player until you get is no longer a proposed update.

    For Adobe Reader, which is 11.0.8 as you can see from what the above posted other versions web page.

    If you have updated to the latest version of AR which is available for your OS (XP SP3) then you are fine and can ignore the page check plugin: the plugin AR.

  • On the right of the adressbox, I always have Yahoo then Google, how can I solve that, I already delete Yahoo from the list in the box search, but every time I start firefox Yahoo is back. Thanks Ron Mijtelen ter, Amsterdam.

    Question
    On the right of the adressbox, I always have Yahoo then Google, how can I solve that, I already delete Yahoo from the list in the box search, but every time I start firefox Yahoo is back. Thanks Ron Mijtelen ter, Amsterdam.

    Hi Ron,

    Have you looked at article in the Knowledge Base using the search in Firefox bar? There are lots of good information in there. You happen to have an installed Yahoo! toolbar? You must disable or delete as well if you do. Try to start Firefox in Mode safe mode by holding down the SHIFT key while starting Firefox. If you have any problems using the safe, it's a matter of add-on or extension.

    Hope this helps!

  • Is there a way to link to songs that are already in my ITunes library, so that they will always play together?

    Is there a way to link to songs that are already in my ITunes library, so that they will always play together?

    N ° not with iTunes. There are third party tools that can bring together two files, but you have them separated in iTunes, but considered as a unit.

    TT2

  • My iPhone does not to import! How can I appear in the Photos and delete those that are already imported?

    My iPhone does not to import! How can I appear in the Photos and delete those that are already imported?

    My iPad appears fine with an option to import the 'new' photos and then delete them once they are imported. However my iPhone appears not at all on the pictures. Although most is already imported via the cloud, some are not, but more importantly, I would remove at least half of 30 000 photos that are taking place on my phone and a "clear items after button import" would be nice right now! I tried to turn off photo stream on my phone, but it still does not appear in the application.

    What can I do?

    Thank you!

    If you use iCloud photo library you cannot delete pictures after the import (or) - deletions on any device will be on all devices - if storage is a question about a device set to use optimized photos

    LN

  • How can I keep to synchronize photos from my PC that are already on my iPad?

    I have a folder with 1000 images on my PC and I use iTunes to synchronize these images on my iPad. Now, these 1000 images are on my iPad. Large. Now, if I add 10 photos to the same folder on my PC and I have then to add 10 new photos to my iPad, I have to re-sync every 1000 previous images that are already on my iPad just to get 10 new? Alternatively, it will ignore those already on my iPad and transfer only the nine? Thank you.

    The synchronization process includes an "analysis" of what already exists. You should see the new net images actually transferred.

  • How can I remove photos from my iPhone that were already imported pictures?

    Hi all

    The camera on my iPhone now has 2000 + photos on it which have already been imported. photos (not iPhoto). At least I am sure that I imported the. Photos knows that they have been imported, but I see no easy way to just delete the photos that have already been imported. What should do?

    I ran a test, import of some of them and by checking the box "delete after importing", and it was successfully deleted photos off the phone. BUT each of the imports is now duplicated in my photo library. What a drag! I don't want to have to go manually by the bias of 2000 + photos, manually remove duplicates when Photos already know that they were already imported at first.

    In iPhoto, you can plug in your phone, import your photos but not the remove immediately after the import, and the next time you connect your phone, iPhoto would say "XX pictures have already been imported. You want to remove them? "It's ideal for cautious people who wanted to verify that the photos had successfully transferred before deleting.

    Any help? Is there something that I am missing in Photos?

    Thank you. -Josh

    You can selectively remove from your phone with the Image Capture (in the Applications folder).

    Photos.app forum is here

    Photos for Mac

  • I cannot download my purchase, even when the album said that has already been paid, what can I do?

    I cannot download my purchase, even when the album said that has already been paid, what can I do?

    What happens when you try to download it? And you try to download from the purchased for example section if using iTunes on your computer, click on your name / icon to the top right of iTunes then click purchased on the popup.

    If it does not show there then check if you have hidden it: mask and unmask purchases iTunes or iBooks on your Mac or PC - Apple support

  • Online purchases of HP was not delivering additional offers that have already paid.

    Hi all

    I bought the laptop of HP 15-r078tu of the hp online shops.

    Its price was 23990 Rs and I also selected 2 offer Zack with it.one is Macfee antivirus with a value of 499 Rs and Rs. 3499, of a value of more than 2 years warranty. In total, I paid 27 987 Rs.

    Laptop has been delivered to me two days ago, but these two things were not that I already paid for.

    Please advice me as what to do.

    I don't want to lose faith in HP.

    Thank you and best regards.

    I just sent you a private message. If you are unsure how to check your messages from the forum, this post has instructions

Maybe you are looking for

  • How will I know if cookies are disabled?

    I followed the instructions to disable the cookies, but I don't know any way to check to see if they were?

  • No sound after updates

    I use a HP Envy TS m6 Sleekbok running windows 8.1 64-bit.  It is only my second day using this computer and asked do updates from HP to it, I have no sound?

  • Windows Media Player adding music/Playlist problems like reading list will not be updated

    OK, so for some strange reason don't let not my WMP add me any music library. My music is in my music folder and when I click on individual songs they will open in the POM, but they will not remain in the library. In addition, it doesn't let me updat

  • Concept of the association and authentication?

    Hello, hope someone can enlighten me on that.  We have a WLC 5508 with some WAP (1131 and 1242).  Our wireless clients using Basic authentication against our AD certificate (i.e. the computer cert and cert user are required).  However, from time to t

  • Lost Local & roaming under users

    I lost Local & Mobile files under users.  There was another but I can't remember it. I've included a screenshot of search for Windows Explorer to "Roaming". How can I fix my users subfolders? I want to backup my MS Word 2010 Custom.dic files.