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 3677264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:12:01+00:00 2026-05-19T03:12:01+00:00

I have one list, which the item render it`s like this: link . But

  • 0

I have one list, which the item render it`s like this:link.
But now I need to enable or disable the button delete depends the view state which my List is inside.

This is my view(which contains the list):

<s:states>
    <s:State name="main" />             <!-- Navigation.CART_MAIN  -->
    <s:State name="cash" />             <!-- Navigation.CART_CASH  -->
    <s:State name="credit" />           <!-- Navigation.CART_CREDIT  -->
</s:states>
    <s:List id="theList"
            width="480" height="240"
            x="69" y="82"
            dataProvider="{model.products}"
            useVirtualLayout="false"
            itemRenderer="com.png.vm.ui.components.ProductCartThumbnail" >

    </s:List>

The thing is that I just want to enable the delete buttons inside the itemRender when the screen is using the state “main”

  • 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-19T03:12:02+00:00Added an answer on May 19, 2026 at 3:12 am

    Another option would be to create separate itemRenderers and use the itemRendererFunction.

    I’ve taken this example from similar question that was asked earlier and modified it a bit to suit your needs:

    flex 4 list ItemRenderer: how can i have different itemrenderers for different rows?

    <fx:Script>
        <![CDATA[
            import renderers.*;
    
            import mx.core.ClassFactory;
            import spark.skins.default.DefaultItemRenderer;
    
            private function list_itemRendererFunc(item:Object):ClassFactory {
                var cla:Class = MainItemRenderer;
                switch (currentState) {
                    case "main":
                        cla = MainItemRenderer;
                        break;
                    default:
                        cla = CashCreditItemRenderer;
                        break;
                }
                return new ClassFactory(cla);
            }
        ]]>
    </fx:Script>
    
    <s:List id="theList"
            x="69" y="82"
            itemRendererFunction="list_itemRendererFunc"
            dataProvider="{model.products}"
            useVirtualLayout="false">
    

    EDIT:
    Here’s the other solution that was used. You can designate different itemRenderers by declaring different property values for each state.

    <s:List id="theList" 
            width="393" height="223" 
            x="42" y="69" 
            dataProvider="{model.products}" 
            useVirtualLayout="false" 
            itemRenderer.main="com.png.vm.ui.components.ProductCartThumbnail" 
            itemRenderer="com.png.vm.ui.components.ProductCartThumbnailReadOnly">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list view control which at the moment only allows one item
I have a list which contains duplicate item values (by ID), but with a
I have one std::list<> container and these threads: One writer thread which adds elements
I have written a simple CRUD form which has one select list. However the
I have a list of e-mails from one database which I want to check
I have to implement a one linked list but it should put object in
I have csv file like this: item,#RGB item1,#ffcc00 item1,#ffcc00 item1,#ff00cc item2,#00ffcc item2,#ffcc00 item2,#ffcc00 item2,#ffcc00
I have a list which is like, tlist = [0.0, 0.07, 0.13, 0.15, 0.2,
I have two screens the one which list the records in a listview ListView
So i have one model with list of all item i have. And other

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.