Display a default Image in the case of the Image src attribute points to null

Hello

I am display pictures on DataGrid by reading an XML file.
This works very well if the src of the Image is present.
Now my question is that sometimes the src of the Image can be null, so in this case, I need to
display some default Image.

< mx:HBox id = "hBox" >
< mx:Image source="{rep.currentItem.@src}"/ >
< / mx:HBox >


< images >
< image src = "images/One.png" / > "
< src="images/Two.png"/ image >
< image src = "" / >
< / images >

Please tell me how to show a default Image in case of Image src attribute is null.

Please share your ideas on this.

Thanks in advance.

bind the source of the image to a function

then write a function to detect if an image is present

private void getImage (): String
{

If ( rep.currentItem.@src == null)

{
return "default.png";

}

on the other

{

Return rep.currentItem.@src;

}
}

Tags: Flex

Similar Questions

  • When you use Windows Explorer to view the files and folders, the thumbnails of image files appear briefly then are replaced with the default icon of the image file. I tried the answers to similar problems, but none worked.

    Browse the folders with image files, I cannot see the thumbnail icons for images correctly.  I know, it should be possible, but I can't do it.

    When I first open a folder in Explorer, I see the correct images for a fraction of a second, then all images are replaced by the thumbnail of the image file (which looks like part of a digital SLR).
    I put all folders to display picture to display the preview and the filter, and the "always show icons never thumbnails" is not checked.  Display file icon "on the photos' is unchecked (I tried checking, too, without change).  I also deleted the thumbnails using disk cleanup as suggested on another question, but which did not allow them.
    The result is that, if I want to open an image for editing or downloading, I have to use a third-party application (for example, Pentax Photo Browser) to preview images, and then return to the Explorer window to select the correct file by name. Don't try to difficulty of these things that are not broken.

    izzlecrate,
    You might want to try it and I just did this procedure myself a moment ago and surprising, it worked!  First of all I must tell you that I have Windows Vista, but the information I got was for Windows 7 and it worked.

    First: You must create a NEW FOLDER and put it on your desktop.
    Second: Move or copy the contents of the original file in the NEW FOLDER on the desktop. I copied the content, just in case something went wrong.
    Third: After that is finished and all the contents are inside you.
    Fourth: On the desktop right click on the folder and click Properties at the bottom of the box.
    Fifth: Click Customize tab at the top and then the Middle click on DEFAULT settings for the folder.  Click on apply to, click OK and your done

    NOW! You can move the folder wherever you want by drag-and - drop the folder and when it's done and that's the best part, you should see the thumbnails of the folder on the EDGE of the folder that you just created.  It worked for me and I hope it works for you.
    I have 10 years of experience with my computer and have troubleshooted my friends for viruses and other computer problems successfully.  I'm advanced computer user.

    That this is done, it restores the folder its original settings.  Good luck! Rick

  • Display a default sous-suite when opening the file in the editor of TestStand sequence

    Is there a way to set the default display sequence when open a file of sequence?

    Seems that the steps for MainSequence are generally displayed first what existing openning sequence.

    How I put it to display an another sous-suite when I open the movie file, I created.

    Or if it displays one sous-suite other than MainSequence, how to set this back to display by default when MainSequence reopenning the file in TestStand.

    Jeff,

    Sequences are stored in files in sequence in the order of 0 - N.  The default sequence will be the 0th.  To change the order in the sequence editor, you can click on the bar of the above sequence sequences.  Keep clicking until there is no arrow on it.  He is the true order of the sequences in the file in the sequence.  Drag the desired visible upward.

    See the image so that you know what I mean.

    Hope this helps,

  • change the video thumbnails from the icon of the default program in the image of the video

    Hello, when I capture a video on the web using a download manager and place in a folder, open the folder and select "Large icons", it displays the image by default.  I want to display an image of the video.

    I tried to uncheck 'display the file on the thumb icon '.  And I tried to check it out.  It has not changed anything.

    I tried to change the 'default' program, but the thumbnail does is display the image of the new default program.

    I tried to "Set your default programs" to "Windows Photo Viewer (these are responses from Forum site)."

    Nothing works.  Can you help me?

    Thank you, Stephen box * address email is removed from the privacy *.

    Vista.

    Vista has no support for Thumbnailer for mp4 files. There are extensions of the environment that offer this feature, which can run Windows Vista.

    REF:
    Add thumbnails to all your multimedia files in Windows with Media Preview - freewaregenius.com
    http://www.freewaregenius.com/Add-thumbnails-to-all-your-media-files-in-Windows-with-media-preview/
  • Edited in Photoshop does not correctly display in Lightroom after recording the images

    Hello

    I recvently EU cloud Adobe and upgraded from Lightroom 3 or 4.  Since the upgrade I had problems with Lightroom not correctly display images edited in Photoshop.  Instead of the photoshop image, it creates a new jpeg image and appears in the library.  the PSD is not loaded into the library.

    I take a jpeg image of my library and shoosing the change based on Photoshop.  By selecting Edit a copy, I'm tried with the original and edit a copy with lightroom adjustments as well as with the same results.

    In Photoshop, I duplicate the base layer, the image upscaling, running some filters, addition of volunteering adjustment layers.

    I save the image in Photoshop format in the original folder where the original jpeg was in the Lightroom library.  I record with maximize compatibility on.

    When I return to Lightroom, the catalog displays the two files, the original jpeg and a copy identical to it, NOT the new file in photoshop with alterations.  If I go in the folder images occupy in the Finder using the Finder command show two images link to the same original jpeg format.  The modified file to photoshop is there in the folder but does not appear in Lightroom unless I drag and drop it.

    I've disabled all the filters and ensured that the sort is sort by name.  The image does not automatically appears in Lightroom after mounting.  Any suggestions?

    Thanks for any help!

    PS. I'm not looking for the subject, and there are discussions since 2007 and lightroom 2 but their solution was to start from scratch basically and I have a carefully labeled, starred and labeled catalog of more than 30 000 images and really don't want to do that

    Images that are edited in Photoshop will be displayed automatically in Lr only when the image file saved in Photoshop is identical to open LR.

    You say you open a jpg of Lr, then edit in PS-among other things-adding a few layers. Layers are not supported in JPG format, so you must either save it as a psd or a copy in jpg.

    In both cases, is not the same image as the one opened in Lr file, so it will have to be imported into Lr appears. If flatten you your image after editing in PS and then do a to your JPG - not a - it will be displayed in Lr.

    PS: the only exception is when you open a raw image from Lr into PS and you save it to PS in the format of file specified in Lr for external mounting. The saved file is automatically displayed in LR.

    Post edited by: web-Weaver; PS added

  • Display a different image and text on the Quiz result based on percent reached

    Captivate v5.5

    I have a quiz with a pass mark of 80%.

    I want the text and the background image is based on the success or failure.

    If the score is less than 80%, displays a picture (sad face) and a relevant text 'failed ".

    If the score is 80% or more, show another picture (happy face) and a relevant text "passed."

    I help Lilybiri and the stem when I used Captivate v4 - but cannt find the details.

    (Liybiri/Rod...) someone can help me once again and explain the process.

    Thank you

    Noel

    Hi Noel,

    I don't know if you read that my blog post on the features of Question slides and slide to score? And somewhere I have a topic customization review messages (also on the slide of score) as well.

    If you want to only two situations: success or failure, it will be pretty easy. The pass/fail is stored in the cpQuizInfoPassFail of system variables. This system variable has its final value when you go to the slide to Score, so you can use it in a conditional action advanced at the entrance to this slide to Score. The idea is that you have both images and text captions ready and hidden and you show one of these, based on the conditional action. And you must get rid of the message default review on the slide to score, but without deleting the placeholder review if you want to allow the review.

    Is that what you want?

    Lilybiri

  • How to choose the display by default when you use two screens on my Mac Pro?

    How to choose the display by default when you use two screens on my Mac Pro?

    The default view when you have several is made that you drag the little icon in the menu bar in this pane:

    .

  • Is it possible to change the default image spacing in the pages of permanently?

    Currently the spacing of default image is 12 when you insert a picture into pages and go to the tab reorder. Is there anyway this change constantly at 0, so each time you insert an image should not change it?

    Organize the spacing of text Wrap is a per image basis cannot set a different default value of 12 pt and adjustment.

  • Windows 10. installed iTunes version 12.4.0.119. I have several iTunes libraries. On most of them display-&gt; ' display as ' does not show the grid option. A library of fact.  It's all music, with no video media. By default seems to be a list that is unc

    Windows 10. installed iTunes version 12.4.0.119. I have several iTunes libraries. On most of them display-> ' display as ' does not show the grid option. A library of fact.  It's all music, with no video media. By default seems to be a list that is unchangeable.

    Select the sidebar if hidden. View options > view as may depend on which of the options for the song, artist, album, etc. are selected in the sidebar.

    TT2

  • Image not displayed does not correctly in the image control to the small zoom level

    I display a picture in an image control with a zoom factor of ~0.015 and it is displayed as shown in the picture 1.jpg.  When I Zoom in a little bit more to ~0.016 the image is displayed correctly, as shown in the picture-2.jpg.  The two images are attached.

    Why the image is displayed as a "gray band" in the first picture?  What should I do to have the picture displayed correctly at any zoom factor?  I use LV 2011 with the module for development of vision associated with Windows 7.

    Thank you

    Jonathan-LV


  • All users of Win XP icon - the icon image change default image

    original title: all users of Win XP icon

    I created an icon (shortcut) in windows XP under profile all users. I packed up, and then a msi that would place under all users when th msi is run. The question I have is that the shortcut works fine but won't stay icon (image) and I has a value default image icon appears. If explore you the where the shortcut is... The icon shows (in the user profile all).

    How can I fix?

    Hi Peace_DOR,

    See the below Microsoft article and try the steps mentioned, check if it helps.

    Icons randomly change to different icons

    http://support.Microsoft.com/kb/132668

  • Default printer in the folder images in Vista Ultimate

    I tried to understand why the PICTURES folder using my FAX printer by default when I always set my default system for the normal printer printer.  How can I see what the printer PHOTOS folders options are to choose a default printer?

    Hi daveshrader,

    Thank you for using answers Forum.

    If I read your post correctly, your printer is the default device and working properly.
    You just want to know why Fax is listed first when printing?

    Do you have a fax device connected to the computer?
    Do you use it with a fax? Do you use efax?
    If your printer is set as default, it should appear in the selection box.

    I suggest to perform a clean boot to see if some startup programs may conflict with the printer.

    To help resolve the error and other messages, you can start Windows Vista by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts. This article describes how to solve problems in Windows Vista by performing a clean boot. This article also describes how to start the Windows Installer service and how to reset the computer so that it starts as usual.

    Note When you perform a clean boot, you may temporarily lose some functionality. When you start the computer as usual, the function returns. However, you may receive the error message, or you can experience the original behavior.

    If the computer is connected to a network, network policy settings may prevent you from following these steps. We recommend strongly that you do not use System Configuration utility to change startup options on the computer, unless a support engineer Microsoft directs you to do so. This can make the computer unusable.

    a. log in the computer using an account with administrator rights.

    b. click Start collapse this image enlarge this image, type msconfig.exe in the Start Search box and press ENTER to start the System Configuration utility.

    The collapse of this image to this image if you are prompted for an administrator password or for confirmation, type your password or click continue .

    c. under the general tab, click Selective startup , and then clear the Load Startup items check box. (The box use the Boot file is not available.)

    d. on the Services tab, select the hide all Microsoft services check box and then click on disable all .

    Note Following this step lets services Microsoft continue to run. These services include networking, Plug-and-Play, record of events, error reporting, and other services. If you disable these services, you can permanently delete all restore points. Do not do this if you want to use to restore the system with the existing restore points.

    e. click OK , and then click restart .

    Step 2: Enable half the services

    a. follow steps 1a and 1B to start the System Configuration utility.

    b. click on the Services tab and then click to select the hide all Microsoft services check box.

    c. Click to select half of the check boxes in the Service list.

    d. click OK and then click restart .

    Step 3: Determine whether the problem returns

    If the problem persists, repeat steps 1 and 2. In step 2, click to clear half of the check boxes that you have initially enabled in the Service list.

    If the problem does not occur, repeat steps 1 and 2. In step 2, select only half of the remaining check boxes that are cleared in the Service list. Repeat these steps until you have selected all the check boxes.

    If only one service is selected in the list of services , and you the problem persists, the service selected the cause of the problem. Go to step 6. If no service is causing this problem, go to step 4.

    Step 4: Enable half of the startup items

    a. perform a clean boot by repeating step 1.

    b. click on the Startup tab and then click to select half of the check boxes in the startup item list.

    c. click OK , and then click restart .

    Step 5: Determine whether the problem returns

    If the problem persists, repeat steps 1 and 4. In step 4, click to clear half of the check boxes that you have originally selected in the startup item list.

    If the problem does not occur, repeat steps 1 and 4. In step 4, select only half of the remaining check boxes that are cleared in the startup item list. Repeat these steps until you have selected all the check boxes.

    If only one startup item is selected in the startup item list, and you still experience the problem, start selected in the list element is the service that is causing the problem. Go to step 6.

    If no startup item causes this problem, a Microsoft service most likely the cause of the problem. To determine which Microsoft service may be causing the problem, repeat step 1 and step 2 without selecting the hide all Microsoft services check box in each step.

    Step 6: Resolve the problem

    After you determine the startup item or the service that is causing the problem, contact the manufacturer of the program to determine if the problem can be solved. Or, run the System Configuration utility, and then click to clear the check box of the element of the problem.

    Step 7: Reset the computer to start as usual

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:

    Click on start to reduce this image enlarge this image, type msconfig.exe in the Start Search box and press ENTER.

    The collapse of this image to this image if you are prompted for an administrator password or for confirmation, type your password or click continue .

    On the general tab, click the Normal startup option, and then click OK .

    When you are prompted to restart the computer, click restart .

    Please let us know if that helps.

    Chris
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Cannot use Jasc Paint Shop Pro as the default image with Windows 7 program

    I try to use Jasc Paint Shop Pro with Windows 7. I can't use it as the default image program. I give me and error message when I try to open an image. "There was a problem sending the command to the program.
    This is a new HP Pavilion model S520y

    What version you trying to run? According to the website, the X 3 version is compatible Windows 7...

    http://www.Corel.com/servlet/satellite/us/en/product/1184951547051#TabView= Mike Hall MVP - Windows Desktop Experience http://msmvps.com/blogs/mikehall/

  • the default images in win 7 Home premium

    Hello

    The default pictures in the pictures in the LIBRARY folder are missing one or two of them, and I want to restore them. Restore works only restores files (which you expect to restore the photos), but it is not. Any ideas please?

    Not sure, but try to create a new user and see if the images appear in the users folder. If they do, through copy and delete the user account.

    EDIT - if I searched for what you need, I just did a search on my system, you should also find in:

    C:\Windows\winsxs\x86_microsoft-Windows-photosamples_31bf3856ad364e35_6.1.7600.16385_none_974f72e1e322d188

    Or at least they seem to be on my system (32-bit). Not sure if the long numbers will change or not and may vary on a 64 bit system.

  • Default scale to the size of the image in 2015 CC

    Other issues on this subject come from 2012.  I use CC 2015.  I have preferences - default scale of size of frame check box. He has always worked in this project.  I thought that this meant simply that when you cut large images in the timeline, they automatically adjust to the size of the current image of the project. I've done several times before, and I can resize images - zoom - without loss of quality.   All of a sudden when I'm cutting the large images (JPEG, etcl) in the timeline with this project that's making them huge in the Progam monitor.  Am I missing something?

    Thank you

    Patrice

    and I can resize images - zoom - without loss of quality.

    Unfortunately this is not true. When you use default scale to the size of the image the image is set to 100%. Which means that when (zoom) amplify it exceeds 100%, resulting in a loss of quality.

    Select all of the images on the timeline, right-click and press Set to the size of the image.

    It suits them also in the chassis, but according to their original format.

    When you zoom in there is no loss (until you reach 100%).

Maybe you are looking for