Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6130161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:49:33+00:00 2026-05-23T16:49:33+00:00

Sorry, this is probably a really easy to answer question, but how in Flex

  • 0

Sorry, this is probably a really easy to answer question, but how in Flex can I display a message within a Spark List component that states that the List is empty. For example if I have a List showing number of jobs outstanding, if my List is empty then I want a message displayed across the List stating “there are no jobs to perform”.

I’d rather not use an Item Renderer because then it’s an Item (the list is not empty) and the item can be selected.

This seems like it should be very trivial and I hope it is.

Thanks in advance,
Phil

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:49:33+00:00Added an answer on May 23, 2026 at 4:49 pm

    You could work with an overlay that will only be shown if the dataprovider has no items, like so:

    <s:List dataProvider="{dp}" left="0" right="0" top="0" bottom="0" />
    
    <s:Group id="emptyMsgBox" left="0" right="0" top="0" bottom="0" alpha=".7"
             visible="{!dp.length}" includeInLayout="{!dp.length}">
    
        <s:Rect left="0" right="0" top="0" bottom="0">
            <s:fill>
                <s:SolidColor color="0x000000" />
            </s:fill>
        </s:Rect>
    
        <s:Label text="no items in list" color="0xffffff" 
                 verticalCenter="0" horizontalCenter="0" />
    </s:Group>
    

    You could also use states instead of the binding between ‘visible’, ‘includeInLayout’ and ‘dp.length’

    Edit: if you would like this behavior in all your List components, you can create a custom skin for List, like this:

    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark"> 
    
        <fx:Metadata>
            [HostComponent("spark.components.List")]
        </fx:Metadata> 
    
        <s:states>
            <s:State name="normal" />
            <s:State name="disabled" />
        </s:states>
    
        <s:Rect left="0" right="0" top="0" bottom="0" id="border">
            <s:stroke>
                <s:SolidColorStroke id="borderStroke" weight="1"/>
            </s:stroke>
        </s:Rect>
    
        <s:Rect id="background" left="1" right="1" top="1" bottom="1" >
            <s:fill>
                <s:SolidColor id="bgFill" color="0xFFFFFF" />
            </s:fill>
        </s:Rect>
    
        <s:Scroller id="scroller" left="0" top="0" right="0" bottom="0" 
                    minViewportInset="1" hasFocusableChildren="false">
    
            <s:DataGroup id="dataGroup" 
                         itemRenderer="spark.skins.spark.DefaultItemRenderer">
                <s:layout>
                    <s:VerticalLayout gap="0" horizontalAlign="contentJustify" 
                                      requestedMinRowCount="5" />
                </s:layout>
            </s:DataGroup>
        </s:Scroller>
    
        <s:Group id="emptyMsgBox" left="0" right="0" top="0" bottom="0" alpha=".7"
                 visible="{!dataGroup.dataProvider.length}" 
                 includeInLayout="{!dataGroup.dataProvider.length}">
    
            <s:Rect left="0" right="0" top="0" bottom="0">
                <s:fill>
                    <s:SolidColor color="0x000000" />
                </s:fill>
            </s:Rect>
    
            <s:Label text="no items in list" color="0xffffff" 
                     verticalCenter="0" horizontalCenter="0" />
        </s:Group>
    
    </s:Skin>
    

    This is a trimmed down version of the skin class, but to summarize: all you do is add that overlay Group to the original Spark ListSkin in exactly the same way as in the previous example.
    Apply it to all List components with CSS:

    s|List {
        skinClass: ClassReference("my.custom.skin.ListSkin");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry, this is probably a really stupid question, but is it safe to run
Sorry this is probably a really silly question but I am developing a WPF
Sorry if this sounds like a really stupid question, but I need to make
Sorry if this is a really basic question but it's been really getting to
Excuse what is probably a really basic question but how do I achieve this.
Ok sorry this might seem like a dumb question but I cannot figure this
Sorry for this not being a real question, but Sometime back i remember seeing
This is probably a noob question that I will get slated for but here
This probably has been asked before but all I can find are questions regarding
this question probably wont be explained very well and that's because I don't really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.