Showing/hiding images in a DataGrid ItemRenderer flex

Hi,
     I have datagrid in that i have a itemRenderer in which i am loading images. What i need to do is i have to hide one or two images in tha datagrid.
For example if i have ten rows of data with image means i need to hode 4 rows images. Please any body help me.
Regards,
Jayagopal.
Message was edited by: Jayagopal Flex

Try adding visible='{data.participant_count>0}' to your HBox or Component
-K

Similar Messages

  • How do I show an image in a DataGrid column?

    I'm not sure that this is possible. I would like to show an
    image in a datagrid column based on the data that the grid is bound
    to. Is there any way to do this? I'm using Beta 3.
    Thanks!

    Yes, you need a custom itemRenderer. This can be inline or a
    custom class.
    Tracy

  • DataGrid itemRenderer, Loader & Image

    How is it possibe to render an image in a DataGrid when the
    image content has been loaded through the method loadBytes() from a
    Loader object ?

    Is this what you need?
    http://www.adobe.com/devnet/flex/quickstart/using_item_renderers/
    Rgds
    JFB
    "C?driic" <[email protected]> wrote in
    message
    news:fcddcq$ruo$[email protected]..
    > How is it possibe to render an image in a DataGrid when
    the image content
    > has been loaded through the method loadBytes() from a
    Loader object ?

  • Help needed to add an image to a datagrid cell in actionscript

    Morning all,
    I am still quite new to flex development and I have an application which uses xml to populate a datagrid. One of the row columns should display a small image but I don't know how to do that.
    Can anyone show me how to add an image to a datagrid cell in actionscript?
    I've added a sample of the code I have written already below. Any help would be much appreciated.
    Thanks in advance,
    Xander
    My XM
    <?xml version="1.0" encoding="UTF-8"?>
    <dataset>
    <modules>
    <module id="1">
    <icon>assets/sample_image1.png</icon>
    <key>core</key>
    <name>Core</name>
    <description>Description of module</description>
    <installed>Wednesday, 24th June 2009 @ 15:59 UK</installed>
    </module>
    <module id="2">
    <icon>assets/sample_image2.png</icon>
    <key>webproject</key>
    <name>Web Project</name>
    <description>Description of module</description>
    <installed>Wednesday, 24th June 2009 @ 17:32 UK</installed>
    </module>
    </modules>
    </dataset>
    My Actionscript
    private function dataSetHandler(event:Event):void {
        var ds:XML = new XML(event.target.data);
        var rows:XMLList = ds.elements('modules').elements('module') as XMLList;
        var columns:Array = new Array();
        for (var i:int=0; i<rows[0].elements().length(); i++) {
            var column:DataGridColumn = new DataGridColumn();
            var tag:String = rows.*[i].name();
            column.headerText = rows.*[i].name();
            column.dataField = rows.*[i].name();
            if (tag == 'icon') {
                var img:Image = new Image();
                img.id = "iconpath";
                img.width = 23;
                img.height = 20;
                img.source = rows.*[i].name();
               column.itemRenderer = img;   <-- this line shows as an error when I try to compile
            columns[i] = column;
        mydatagrid.columns = columns;
        mydatagrid.dataProvider = rows;

    you cant just set image object to itemrenderer, you need to use classfactory.
    http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_4.html

  • Image in a DataGrid

    Hello, I want to introduce a image in one datagrid column but I don't know why. I'm trying doing that:
    private var columns:ArrayCollection = new ArrayCollection([
                                {headerText: 'Image', dataField: 'column1', itemRenderer:'xxxxx', width: '5' },
    private var date:ArrayCollection = new ArrayCollection([
                   {column1:'../img/clip.png',
                   {column1:'../img/clip2.png,}])
    What I have to put in itemRenderer? Or I'm doing totaly wrong
    It's better if I do
    [Embed(source="img/clip.png")] public var buzonIcon:Class;
    and then use buzenIcon in column1:.....
    What is the solution?
    Thanks!

    Hi, Pls find the solution of the your problem.
    MainApplication.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    private var dgArrayCollection:ArrayCollection=
    new ArrayCollection([
    {imgPath:'assets/img1.png', names:'John'},
    {imgPath:'assets/img2.png', names:'Alex'},
    {imgPath:'assets/img3.png', names:'Peter'},
    {imgPath:'assets/img1.png', names:'Sam'},
    {imgPath:'assets/img2.png', names:'Alis'},
    {imgPath:'assets/img3.png', names:'Robin'},
    {imgPath:'assets/img1.png', names:'Mark'},
    {imgPath:'assets/img2.png', names:'Steave'},
    {imgPath:'assets/img3.png', names:'Fill'},
    {imgPath:'assets/img1.png', names:'Abraham'},
    {imgPath:'assets/img2.png', names:'Hennery'},
    {imgPath:'assets/img3.png', names:'Luis'},
    {imgPath:'assets/img1.png', names:'Herry'},
    {imgPath:'assets/img2.png', names:'Markus'},
    {imgPath:'assets/img3.png', names:'Flip'},
    {imgPath:'assets/img1.png', names:'John_1'},
    {imgPath:'assets/img2.png', names:'Alex_1'},
    {imgPath:'assets/img3.png', names:'Peter_1'},
    {imgPath:'assets/img1.png', names:'Sam_1'},
    {imgPath:'assets/img2.png', names:'Alis_1'},
    {imgPath:'assets/img3.png', names:'Robin_1'},
    ]]>
    </mx:Script>
    <mx:VBox width="300" height="100%"
    horizontalAlign="center"
    verticalAlign="middle">
    <mx:DataGrid id="dg" width="50%"
    height="100%"
    borderStyle="none"
    dataProvider="{dgArrayCollection}"
    >
    <mx:columns>
    <mx:DataGridColumn dataField="color" itemRenderer="DatagridItemRenderer"/>
    <mx:DataGridColumn dataField="names" headerText="Names"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:VBox>
    </mx:Application>
    DatagridItemRenderer.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
    width="100" height="30" horizontalGap="5"
    horizontalAlign="center"
    horizontalScrollPolicy="off" verticalScrollPolicy="off"
    >
    <mx:Script>
    <![CDATA[
    override public function set data(value:Object):void
    super.data = value;
    ]]>
    </mx:Script>
    <mx:Image width="75" height="30" source="{data.imgPath}"/>
    </mx:HBox>
    Let me know if you have any issue with this.
    With Regards,
    Shardul Singh Bartwal

  • DataGrid, itemRenderer, viewStacks

    I am using an inline itemRenderer for an image on a Datagrid
    which rests in a viewStack. However, if the Datagrid is not in the
    first index of the viewStack the itemRenderer will not load. I've
    tried changing the creationPolicy of the viewStack with no avail.
    Any ideas?
    Thanks
    Ruben

    In the following code (modified version of yours) if you
    remove enabled="false" from the milestoneGrid datagrid it seems to
    work:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    height="200">
    <mx:ArrayCollection id="statusData">
    <mx:Object>
    <mx:itemLabel>M1</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    <mx:Object>
    <mx:itemLabel>M2</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    <mx:Object>
    <mx:itemLabel>M3</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    <mx:Object>
    <mx:itemLabel>M4</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    <mx:Object>
    <mx:itemLabel>M5</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    <mx:Object>
    <mx:itemLabel>M6</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    <mx:Object>
    <mx:itemLabel>M7</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    <mx:Object>
    <mx:itemLabel>M8</mx:itemLabel>
    <mx:schedDate>01/01/2008</mx:schedDate>
    <mx:startDate>01/01/2008</mx:startDate>
    <mx:endDate>01/10/2008</mx:endDate>
    <mx:user>Bob Smith</mx:user>
    <mx:status>overdue</mx:status>
    </mx:Object>
    </mx:ArrayCollection>
    <mx:HBox borderStyle="solid">
    <mx:Button label="Datagrid One"
    click="gridVS.selectedChild=dg1;"/>
    <mx:Button label="Datagrid Two"
    click="gridVS.selectedChild=dg2;"/>
    </mx:HBox>
    <mx:ViewStack id="gridVS" width="100%" height="100%"
    creationPolicy="all">
    <mx:VBox id="dg1" width="100%" height="100%"
    verticalScrollPolicy="off" horizontalScrollPolicy="off">
    <mx:DataGrid id="milestoneGrid" height="100%"
    styleName="myDataGrid"
    width="100%" dataProvider="{statusData}" rowCount="8"
    variableRowHeight="true" enabled="false">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn dataField="itemLabel"
    headerText="Milestone" width="120"/>
    <mx:DataGridColumn dataField="schedDate"
    headerText="Scheduled Start Date" width="120"/>
    <mx:DataGridColumn dataField="startDate"
    headerText="Started"/>
    <mx:DataGridColumn dataField="status"
    headerText="Status"/> <mx:DataGridColumn dataField="endDate"
    headerText="Completed"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:VBox>
    <mx:VBox id="dg2" width="100%" height="100%">
    <mx:DataGrid id="areaGrid" styleName="myDataGrid"
    width="100%" height="100%"
    selectable="true" rowCount="8" dataProvider="{statusData}"
    enabled="true"
    editable="false" variableRowHeight="true" >
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn dataField="itemLabel" headerText="Area"
    width="270" wordWrap="true"/>
    <mx:DataGridColumn dataField="startDate"
    headerText="Started"/>
    <mx:DataGridColumn dataField="endDate"
    headerText="Completed"/>
    <mx:DataGridColumn dataField="status"
    headerText="Status"/>
    <mx:DataGridColumn dataField="user" headerText="Run
    By"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:VBox>
    </mx:ViewStack>
    </mx:Application>

  • Show an Image on a different slide

    I've seen something similarin this forumn to what I want to do, but still not getting it to work. Any help would be appreciated.
    I have an image on slide 1 which has visibile unchecked in properties.... so it does not initially display when slide 1 is displayed.
    When they get to a certian slide I have a click box. When clicked I would like Captivate to jump back to slide 1 and display the image.
    I can get Captivate to jump back to the slide, but cannot get it to show the image.
    For sake of this discussion, I have slide 1, 2 and 3.
    Slide 1 has a yellow box with the visible unchecked in the properties.
    When the learner gets to slide 3 I have a click box with the following Advanced actions.
    I think I'm close but I'm missing something.

    Hello,
    You are on Captivate 4, that is a pity, because I did blog a while ago about hiding and showing objects but in Captivate 5. However the principles are the same: you can not show an object unless the action is executed on the slide where the object sits. Hope this makes sense?
    So in your case, you should perhaps create a user variable, originally=0 and that you change to 1 when the click box is clicked in the action on the slide with the click box. And then you will need a conditional action, to be triggered on entering the slide where the image is. This action checks the value of the user variable, if it is 0 the image will be hidden, if it is 1 it will be shown.
    Here is the link to my blog post:
    Playing Hide-and-Seek with Captivate objects
    I'm willing to help you if you cannot work it out.
    Lilybiri

  • Show an image on a JPanel with GridbagLayout

    Hi All,
    I have a serious problem: I'm building a GUI with following characteristics:
    JFrame in which is inserted a JPanel. This Jpanel has a GridBagLayout.
    In this JPanel are shown diefferent Component types (JTextField, JTextArea, JLabel and so on).
    I would show an image on a apecific free part of this JPanel, without move actual components distribution.
    Now the image is automatically reduced to be insert in a "line/column" according to GridBagLayout, but I don't want this!!!!
    Help me!!!
    Thanks in advance!

    Hello,
    You are on Captivate 4, that is a pity, because I did blog a while ago about hiding and showing objects but in Captivate 5. However the principles are the same: you can not show an object unless the action is executed on the slide where the object sits. Hope this makes sense?
    So in your case, you should perhaps create a user variable, originally=0 and that you change to 1 when the click box is clicked in the action on the slide with the click box. And then you will need a conditional action, to be triggered on entering the slide where the image is. This action checks the value of the user variable, if it is 0 the image will be hidden, if it is 1 it will be shown.
    Here is the link to my blog post:
    Playing Hide-and-Seek with Captivate objects
    I'm willing to help you if you cannot work it out.
    Lilybiri

  • HT2531 Spotlight lists items and shows preview images.  BUT what about showing the location address of an item in my computer. Especially important if I've put the item in the wrong folder and what to locate it without multi-steps. iMac OS 10.5 was more u

    Spotlight lists items and shows preview images.  BUT what about showing the path/location address of an item in my computer.
    Especially important if I've put the item in the wrong folder and what to locate it without multi-steps. iMac OS X 10.5 was more useful.
    Old OSX Spotlight function automatically displayed path/location within the machine:  e.g. desktop/folder/sub-folder/item.
    Can I make Spotlight show the path?

    Press option-command and the path is displayed at the bottom of the little preview window.  Press command-return and the enclosing folder opens. 

  • After connecting a late 2008 MacBook to an external monitor can I show different images on them?

    After connecting an external monitor to my MacBook(late 2008) is it possible to show different images on the two screens at the same time?
    TIA

    Yes. Open System Preference (under the Apple menu) and select Displays. See the instructions in this Apple article for how to continue.
    Best of luck.

  • How to show an image(jpg/gif) on a JTabbedPanel

    Hi
    I tried to show an image on a JPanel of a JTabbedPanel.
    I the only way to show it for some time was this:
    in the StateChangedListener I use drawImage when the selected panel is teh one I want to draw the image at.
    Tracing code makes the panel show, burt when I step
    all the way up, the panel will be repainted without my image.
    I use mediatracker to get the image loaded.
    Any Idea
    Hanns

    JTabbedPane has components as its tabs. Using a JPanel is not mandatory. Try using a JLabel instead with an Icon (use ImageIcon) in it.
    JTabbedPane tabbed = new JTabbedPane();
    tabbed.addTab(
        "my image panel",
        new JLabel( new ImageIcon( "images/MyIcon.gif" ) )
    );if your were referring to the image of the little tabs, use this:
    JTabbedPane tabbed = new JTabbedPane();
    tabbed.addTab(
        "my tab",
        new ImageIcon( "images/MyImage.gif" ),
        myPanel // instance of Component, can be a JPanel or any JComponent you want.
    );

  • Browser should show ALL images, in all formats.

    I recently opened an image for editing from Lightroom to Photoshop, corrected some perspective distortion, and saved the result as a PNG.  Lightroom then failed to show the new image, even after I synchronized the folder.  A respondent in the Lightroom forum said that Lightroom doesn't support PNG, to which I ask, WTF?
    Lightroom should support any format supported by Photoshop.  It displays JPEGs, which aren't a raw format.  Exactly how many products should we have to run concurrently to simply manage images?  Lightroom is supposed to be the product that does it, but if it fails to show all images in each directory, it fails at its purpose.

    MikeLeone wrote: So you think LR should support BMP? PCX? How many cameras store their
    photos in these formats? PS supports them, but why should LR?
    I'll agree with support for PNG, at least as far as exporting, as some
    web sites like using this format rather than JPEG (although the
    reasons for using PNG aren't technical, but legal, AFAIK - licensing
    for using the JPG format - rather than something technical, like
    smaller file size, etc).
    Very true, though I am more arguing that LR should be able to leverage formats available to other Adobe products installed on the same machine more than anything.
    BMP and PCX, no most cameras don't use those formats *anymore*. But I remember having an old camera that took photos in BMP format (it may have been a webcam, but still a camera) which I have in my library from a long time ago. In my day job we still actually use applications that suprisingly enough can only display PCX images; though I never would intentionally keep anything in PCX.
    I think anything it is able to import it should be able to export; but again if you have it natively supported in the Adobe product or universally supported by the OS without additional codec installation it should be supported, even if it is something obscure as PCX.
    MikeLeone wrote:
    That should be a feature request for the camera manufacturers, then,
    shouldn't it? Ask them to share their non-published, proprietary
    drivers with Adobe? Or at the very least, publish an API so LR (and
    presumably, other programs) can call the code (presuming that the code
    is modular enough to be called by other programs, of course).
    Yeah, I understand that neither Canon nor Nikon are supporting DNG files straight out of the camera yet and both still maintain a propreitary formated RAW file, but I would suspect that generally a Canon .CR2 file doesn't change all that much if at all other than the camera identifier from a 20D to a 5D Mk II to the 7D for example.
    Why do current Lightroom users need to wait until Adobe releases 2.6 or 3.0 to be able to use Lightroom with their 7D?
    Why if Adobe releases a Camera RAW update for PS that includes the 7D does it still not work in LR?
    Yes the mfg. need to be more open or pick a standard and run with it, but it just seems excessive for Adobe not to play nice too.
    It is in Canon/Nikon/Adobe's best interest to play nice and share this information with Adobe. So I am betting they are not withholding it. I was getting Canon SDK notifications for the longest time and sometimes months before a Camera was available, and sometimes it was even annouced this information was made available to developers on new camera models. I am sure Nikon does the same thing and Adobe is getting this information from all mfg.
    Christopher

  • I forgot my admin password for my macbook and my macbook doesnt allowme to go on single user or boot up in safe mode or boot up with the option key all it does is show a image of a globe blinking everytime i try to do something

    please people help me i brought this macbook from a friend and now its ****** up its a macbook late 2006 and it dosesnt allow me to do anything everytime i click on a key to go on single user terminal or boot up cd or run on safe mode it shows a image of a globe(earth)

    Somehow the HDD is screwed up. Data saving issue is not directly Toshiba related issue and before you spend time here discussing about such things I recommend you to ask someone with good PC knowledge what can be done about data saving.
    When the HDD is in the notebook again start notebook as first step set BIOS to default settings.
    After doing this install recovery image. After doing this you will have clean preinstalled OS and everything should work properly again.
    I hope you will be able to do this using HDD recovery option.
    How to do this you can find on http://aps2.toshiba-tro.de/kb0/HTD1303440001R01.htm
    Have you maybe created recovery discs?

  • How to show an image in JSP given the bytes[] of the photo?

    Hi all,
    I stored a user's picture in the db as text. For this I simply converted the JPG to bytes[] and from bytes to string: Base64.encode(bytes)
    Now I wish to do the reverse - to 'output' the image on the screen. So given the bytes[] of the image with
              byte[] bytesDB = Base64.decode(userPhotoStr); //userPhotoStr is something like this: /9j/4AAQSkZJRgA...Question: How can I show the image in the JSP page embedded in the page not as download?
    I'm using struts with JSP pages.
    Thank you!!!!

    Images in HTML are to be displayed using <img> element. All what an <img> element can take as image is an URL pointing to the image in question.
    If the image is dynamic, then you can just let that URL point to some Servlet which takes some request parameter or reads the path info, reads/gets the image as byte array or (much more efficient) as inputstream and writes it to the outputstream of the response.
    You may get some ideas out of this: [http://balusc.blogspot.com/2007/04/imageservlet.html].
    By the way, massaging the byte array from/to a String is a terribly bad idea. Just store bytes as computer readable bytes, not as human readable characters, this makes completely no sense. Characters on its turn have to be converted to bytes again after all, but now you've let the DB do the work. All with all a performance pain. Bytes > Chars > Bytes > Chars > Bytes instead of just Byes > Bytes. In database you normally use BLOB, BINARY or equivalent for this in combination with JDBC's PreparedStatement#setBinaryStream() and ResultSet#getBinaryStream().

  • Oracle lite application not showing blob images in BI reports

    Hi,
    We have an application running in Oracle lite, we integrated the BI publisher reports (PDF reports are generated Using Data template and RTF file with Java API for BI publisher) with the application. Its been working fine for a long time.
    Now we are showing some images on the pdf report, the images are stored in the Oracle lite database as blobs. My application fails when translating the Data template to xml data. I am not getting any exception other than out of memory error after a while.
    anybody had the same problem? Let me know if you need more information on this problem.
    Any help will be great!!
    Regards,
    Parthiban Kumar
    Edited by: Parthiban Kumar on Nov 12, 2009 10:45 AM

    Hi Carsten
    That was exactly* I was looking for. Maybe I should Google more in German ;-)
    The main problem was that I defined my image outside the first repeating group (that doesn't repeat, it's always just one object) - the first group is followed by 7 more.
    Just like the "Name" (that's positioned outside the group in the document header), I positioned the image above the table representing the group.
    Doing that, the "Name" is filled correctly, the Image only when the Output Format is Excel or HTML - not Word or PDF ... makes no sense but that's tje way it is.
    After moving the image inside the group....it works great!
    (One more thing...the image size is fixed to the image you use as "dummy". Is there any way to make that more flexible, because now some scaling happens...)???
    @Trent: That was the way we initially did it, but when the size of the row exceeds 32K...you know what happens.. And even with a small image the 32K limit is hit easily
    The way I use it now (very similar to Carsten's description) there is no limit....
    Thank you all!
    Roel

Maybe you are looking for