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

  • SEARCH
  • Home
  • 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 8478491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:45:37+00:00 2026-06-10T18:45:37+00:00

How do I prevent an item from being selected in a List? Let’s say

  • 0

How do I prevent an item from being selected in a List? Let’s say you want to use it for display or other reasons.

  • 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-06-10T18:45:39+00:00Added an answer on June 10, 2026 at 6:45 pm

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Solution 1
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Call preventDefault in the changing handler like so:

    <s:List id="list" dataProvider="{myCollection}" changing="list_changingHandler(event)"/>
    

    The List change handler:

    protected function list_changingHandler(event:IndexChangeEvent):void {
        var item:Object = list.dataProvider.getItemAt(event.newIndex);
    
        event.preventDefault();
    }
    

    The event.preventDefault(); prevents the item from being selected. The code on the line before allows you to get the item that was going to be selected if you are using an ArrayCollection. It may be slightly different for other types of data lists or collections.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Solution 2
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    You can also prevent an item from being selected in the item renderer by calling the stopPropagation method on the mouseDown event like so:

    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark" >
    
        <s:CheckBox id="enabledCheckbox" mouseDown="event.stopPropagation();"/>
    
    
    </s:ItemRenderer>
    

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Solution 3
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    @RIAstar mentioned set enabled to false in the ItemRenderer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know if it is possible to prevent a work item from being
I'm trying to prevent certain keys from being entered into an input box, but
I'm trying to prevent an associated record from being deleted if it has associated
I want to prevent my activity from restarting when I change the orientation from
I have a list of items and I want to make the first item
Can someone advice me how to prevent this error. An item with the same
How can ItemCheckedEventArgs.Item.Selected = ItemCheckedEventArgs.Item.Checked generate The given key was not present in the
To prevent SQL injection, is it necessary to use mysql_real_escape_string() , when magic_quotes_gpc is
I want to prevent the user's concurrent login based on the admin settings. If
I would like to prevent unnecessary use of background-size in CSS3. By the way,

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.