Visible property in ItemRenderer

Hi there,
I have a very basic question. I'm trying to hide a canvas in the itemrender of a list
<mx:List dataProvider="{currentCollection}" width="100%" height="100%">
  <mx:itemRenderer>
   <mx:Component>
    <mx:Canvas visible="false" includeInLayout="false">
    </mx:Canvas>
   </mx:Component>
  </mx:itemRenderer>
It seems that it cannot hide the first element after component? the following code works:
<mx:List dataProvider="{currentCollection}" width="100%" height="100%">
  <mx:itemRenderer>
   <mx:Component>
    <mx:Canvas>
   <mx:Canvas visible="false"includeInLayout="false">
      </mx:Canvas>
    </mx:Canvas>
   </mx:Component>
  </mx:itemRenderer>
But that is pretty pointless-the top canvas anyway takes up the space
Any idea how to hide items in a list? Do i have to make my own itemrenderer?
any advice would be appreciated

There is an alternative:
Take two arrayCollections. The first one holds your application data, so you shouldn't filter this right?
The second one is bound to the dataProvider of your list.
Now, use the filter function of the source array of your first collection to fill your second one. The array.filter function creates a new array!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            [Bindable]
            private var mainColl:ArrayCollection;
            [Bindable]
            private var dp:ArrayCollection = new ArrayCollection();
            private function init():void
                var a:Array = [{label: "Item 1", available: 1},
                                {label: "Item 2", available: 0},
                                {label: "Item 3", available: 0},
                                {label: "Item 4", available: 1},
                                {label: "Item 5", available: 1}];
                mainColl = new ArrayCollection(a);
                showAll();
            public function filterAvailable():void
                dp.source = mainColl.source.filter(function callback(item:*, index:int, array:Array):Boolean
                            return item.available == 1;
            public function showAll():void
                dp.source = mainColl.source.filter(function callback(item:*, index:int, array:Array):Boolean
                            return true;
        ]]>
    </mx:Script>
    <mx:HBox>
        <mx:List dataProvider="{mainColl}" width="400" height="400" labelField="label"/>
        <mx:List dataProvider="{dp}" width="400" height="400" labelField="label"/>
    </mx:HBox>
    <mx:Button label="Show available" click="filterAvailable()"/>
    <mx:Button label="Show all" click="showAll()"/>
</mx:Application>
Dany

Similar Messages

  • Af:column visible property

    Hi,
    I am using JDeveloper 11.1.1.4 and ADF-BC in my application.
    I want to pragmatically control the visible property of the af:column inside the table.
    I have the following code for af:column.
    <af:column sortable="false" headerText="Impact Cat New" id="c7" visible="#{row.bindings.Selected.inputValue}">
    </af:column>
    Initially, the value of 'Selected' will be false when the table is first displayed and hence it should NOT be displayed.
    In the table selection listener,I set the property 'Selected' to true for the selected row and refresh the table[AdfFacesContext.getCurrentInstance().addPartialTarget(tblEmp)].
    But Even after refresh the table is never showing the column for which visible is set as true.
    The table is inside a panelCollection.
    Please advice.
    Regards,
    Praveen

    This won't work, as the column is the container for all rows and the row attribute is only available when the table rows arr stamped. I don't understand your use case. You want to show a column if one row gets selected? Sounds odd to me.
    If you really want to do this, you have to set an attribute outside the table and use the selection listener to switch this attrbute. Then use the new attribute in the columns visible property.
    Timo

  • Webdynpro for ABAP, Enhancement and change of standard "visible" property

    Hi
    Is it possible to change the standard Webdynpro element (in cProjects application), so that the original control "Input" from visible property "Visible" is changed to mine Context variable? How to change that default "Visible" flag in standard element?
    thank you

    Hi Phani,
    Thanks for the info.
    I am able to see if it is not interactive.
    Displaytype is native only.
    Let me explain you the issue in detail:
    Currently Client is calling ZFORM thro Java. They have some issues with JAVA so they want to use Webdynpro to call that ZFORM and the form is ABAP Dic based.
    For Templete source I gave ZFORM name, and it automatically created a 'NODE' wrt the context in the ZFORM.
    Now I have to pass data from difft  node attributes to that 'NODE'.
    Thanks in advance,
    GG

  • Tracking the visible property of a movie clip

    Hello,
    I am trying to track the visible property of a movie clip as
    I need to perform a function when visible = true and another when
    visible =false
    I have tried to use a listener object but I can’t get
    it to work. Can you attach a listener object to listen for the
    visible property?
    I have also tried an IF statement inside the move clip but
    this only knows the state of the ._visible when it first runs.
    I have got it to work with an onEnterFrame function on a
    movie clip inside the one I want to know the property of but I
    don’t like using the onEnterFrame as it uses a lot or
    processor speed
    Is there an easy way to track the visible property of a
    movieclip???
    Thanks
    Sam.

    > thanks for the help but the watch() method doesn't work
    for getter/setter
    > properties. is ._visible a getter/setter property?
    I was afraid of that. Yes, _visible is a getter/setter, most
    properties are. Basically watch() only works on read-only
    properties and custom variables, which is a shame.
    So I don't know of any more elegant way than constantly
    checking to see if the value changed. Centralize it and maybe
    package it in a nice class and you might feel a little better about
    it...

  • Change visible property of iView assigned to page

    Hi,
    When we add an iView to a page, we have some properties like visible, fixed,etc. mentioned along with each iView. Now, I want to change the visible property dynamically using pdk development. How can we achieve this?
    Regards,
    Khushboo

    Hello Mittal,
    As per my understanding you want a way to dynamically edit the property of the PCD objetcs using PDK. SAP provides an API for the same puspose. Please refer to this link for more details
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401
    Regards,
    Raju Bonagiri

  • Visible Property of lable in Webdynpro

    Hi all,
    I have a lable and a inputfield which are hide. I want that when a select something in my dropdownbykey, this two objects get visible.
    How can i do that?
    Regards,
    Nirali

    Hi,
    Please look this code
    1.Create one Droupdownkey UI element in your firstView (Droupdown by key is bind to the one value attribute i.e MonthName)along this u can take 2 lable. For 2 lables you can set Visibility (com.sap.ide.webdynpro.uielementdefinitions.Visibility) property.
    2. in wdinit() method you can write this code
    ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("MonthName"); 
    IModifiableSimpleValueSet values =myType.getSVServices().getModifiableSimpleValueSet();
    values.put("Vijay","Vijay");
    values.put("Kalluri","Kalluri"); 
    wdContext.currentContextElement().setMonthName("Vijay");
    wdContext.currentContextElement().setKalluri(WDVisibility.NONE); 
    wdContext.currentContextElement().setVijay(WDVisibility.NONE);
    3.in Droupdownby key having OnSelect event in that place you can create on method. Under method you can write this code.
    String firstName = wdContext.currentContextElement().getMonthName();
    wdComponentAPI.getMessageManager().reportSuccess("First Name:"+firstName);
    String lastName = wdContext.currentContextElement().getMonthName();
    wdComponentAPI.getMessageManager().reportSuccess("Last Name:"+lastName);
    if(firstName.equalsIgnoreCase("Vijay"))
    wdContext.currentContextElement().setKalluri(WDVisibility.VISIBLE); 
    wdContext.currentContextElement().setVijay(WDVisibility.NONE);
    else
    wdContext.currentContextElement().setVijay(WDVisibility.VISIBLE);
    wdContext.currentContextElement().setKalluri(WDVisibility.NONE);
    Hope this helps u.
    Best Regards
    Vijay K
    Edited by: VijaySAPEP on Jan 4, 2012 4:47 PM
    Edited by: VijaySAPEP on Jan 4, 2012 7:32 PM

  • Visible property

    If I have 20 items in a listbox, each item corresponds to a control cluster. The cluster appears according to the item in the list that the user push while the other ones disappear. This is all in a While loop until the user hit OKAY. Is there a quicker way to set the visible property because the way that I have in mind right now is a case structure that make one visible and the other 19 invisible. This is very tedious because that means that I have to do the same for all 20 cases. Thanks.

    I suspect that vk1 & Veeru are the same person
    Have you started implementing code and need a solution for it?  If so, please post the code so that we can prepare an adequate example.
    R

  • Visible Property of javafx Tab

    Hi
    Is it possible to hide or show the tabs inside a tab panel at run time? I did not see any "Visible" property on Javafx Tab. Is there a way I can hide the tab at runtime?(or later show it if required)?
    Thanx in advance
    -suvarna

    Another option is to simply remove/add the Tab instances from the TabPane.tabs list as necessary.
    -- Jonathan

  • Visible property for transient attribute.

    Hi,
    I am using J developer 11g Release 2.In my page i need to set the visible property for the transient attribute(conform password) because the transient attribute needs to be disable for some condition.I have tried but the property was working only when the attribute is not transient.Can we set the property for transient attribute?
    Help me on this..
    Thanks,
    Suganya.
    Edited by: Suganya on Feb 27, 2012 1:40 AM

    Disabling the visbile property:
    <af:inputText autoSubmit="true" id="it6" label="Table Attr"> </af:inputText>
    <af:inputText partialTriggers="it6" visible="#{bindings.AphdBe.inputValue eq null? 'false' : 'true'} " id="it2" label="Trans Attr"> </af:inputText>like this you should h'd.
    normally we use transiet term in vo's while coming to part ui.
    it will consider as attribute. no thing difference bwtn those attribute as timo says.
    --edited lately.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Visible Property of Symbols

    In Flash, I can set the visible property of a MovieClip with ActionScript as follows:
    coke_mc.visible = false;
    How do I accomplish this in edge?

    Option 1. For Timeline interaction, Select the Element from the Elements Panel, go to the Properties Panel and from the Visibility section (Always On) choose Off.
    Option 2. On handler event interaction, assumming the element name is called coke
        sym.$("coke").hide();    // this hides it
       sym.$("coke").show();   // this shows it
    More API detials here http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html
    Darrell

  • Visible property of Decorations

    How can I change the Visible property of decorations?
    Thanks

    You use property nodes. First select the panel property and wire the reference to another property node and select the Decorations[] property. This will return an array of refnums to your front panel decorations. You then use the index array function to select the decoration you want and use the visible property on that refnum. I've attached a simple example.
    Attachments:
    Visible_Decorations.vi ‏24 KB

  • How to set visible property to href link

    Hi All,
    I want to open the new jsp page in the new tab when will we click on the link in my ADF application.So i tried like this.
    <af:column id="pt_c115" >
    <a id="JspLink" href="AuditLogInfo.jspx" target="_blank">JspLink</a>
    </af:column>
    Im able to view my new jsp page when im click on JspLink link.But here my problem is i have nee to set the visible condition if the 'status' field of adf table is succes only i want to view the link other wise no need to visible my link.
    visible="#{row.bindings.Status.inputValue=='SUCCESS'}" is working for commandbutton.But i'm not able to see any visible property in <a id="JspLink" href="AuditLogInfo.jspx" target="_blank">JspLink</a> .How can i set this condition?Please help me.I'm using JDeveloper 11.1.1.5 version.
    Thanks in Advance!
    Edited by: 851924 on Apr 5, 2012 11:22 PM
    Edited by: 851924 on Apr 5, 2012 11:23 PM

    Instead of using a jsplink you should use an af:goLink which is the adf equivalent and has all the needed properties.
    Timo

  • How to set the disable,visible property in declarative components.

    We have used one declarative component. It consists of 5 buttons (add,delete,save,delete,print). In all of our pages, this declarative component is used. We could bind methods and was able to use each pages seperately (by linking the methods in the backing bean)
    But for implementing the DISABLE,VISIBLE properties, we have added the attributes for this and refered this to the corresponding disable and visible property of the button. In the page all these properties where reflected. But at the runtime these buttons are not coming.
    Can anyone advise how can we set the disable,visible property in declarative components.

    Hi vikram ,
    i hvnt initialized the properties ,
    in my declarative component i have one button say Save button and i want to config 2 properties Disable and Visible
    i added two attributes ( java.lang.Boolean ) say disablr_btn ,*visible_btn* and mapped wth the Save button Properties Disabled and Visible using expressions
    Now the button is invisible while running the page.
    if i remove the mapping from properties Disable and visible , the button is visible
    should i init the properties in faces config , i dnt knw hw to init the properties
    pls advice

  • How to increment array that contains two clusters whose visibility is controlled by a visible property node and selected by a radio button.

    I am trying to use a property node: visible in order to enable or disable one of two clusters. These clusters are in a larger cluster and this larger cluster is in an array. The two clusters are controlled by a radio button (one labeled transistor and the other diode). When diode is selected, the corresponding diode parameters cluster should be visible and when transistor is selected, the corresponding transistor parameters cluster should be visible. In the mean time, the cluster of the device that is not selected should not be visible. There are at least 45 elements in the array (but not more than 45). Data is entered into each cluster (diode or transistor data) for each element in the array via the increment/decrement. The problem is when you select the first radio button (transistor) and enter data, when you increment the array for a new device selection, since a visible property node was used on the cluster, a loop is created where a new cluster is trying to be shown, but the old cluster is also trying to be shown (because it is the one referenced by the property node. How do I get rid of this loop and still be able to increment the array and keep my data intact for future use? Attached is the vi
    Attachments:
    ChooseScan.vi ‏17 KB

    You could try something like this.  However, if you know how to use an xcontrol, that would be a better way to implement the above functionality so that these UI characteristics are not a part of your main VI.  The problem with the above VI is that you're looping every 100 ms just to update your UI.
    Also, try using the "disabled" property node, instead of the "visible" one.  That way, the user will still see the options he has but they will be grayed out.
    Message Edited by Sudhir Gopinath on 06-25-2007 04:45 PM
    S G
    Certified LabVIEW Architect, Certified TestStand Developer, Certified Professional Instructor
    Attachments:
    ChooseScan_1.vi ‏19 KB

  • Outlook Form Region Visible property on outlook 2007.

    Hello,
    I have this code:
    private void AttachementRegion_FormRegionShowing(object sender, System.EventArgs e) {
              try {
                  OutlookFormRegion.Visible = false;
                  Outlook.MailItem mailitem = ((FormRegionControl)sender).OutlookFormRegion.Inspector.CurrentItem as Outlook.MailItem;
                  MailManager mailManager = MailManager.getInstance(mailitem);
                  mailManager.NewTask += AddTaskControl;
                  flowLayoutPanel1.MouseWheel += flowLayoutPanel1_MouseWheel;
              } catch (System.Exception) { }
    But on Outlook 2007 the line "OutlookFormRegion.Visible" bug.

    Hello Aurelien,
    It is not a bug. The Visible property was added in Outlook 2010. 

Maybe you are looking for