Design Studio - Display a dummy image when searched photo does not exist

hello,
I would like to display an employee photo, which should be searched on the server folder with URL.
Each photo name in my folder is : "employeeId.png".
But some employees do not have a photo, and in this case I try to display a dummy photo, which I have in the same folder with employee id 00000000.
My variables are :
- URLlink variable is global variable type URL, which gives a path to my folder with employees photos
- empnb variable is filled with employee id through getSelectedMember on cross table
- filename variable to search a photo on the server
- filename0 variable for those employees for which photo does not existe
I tried to test the existence of an employee photo with getHeigh() method or getImage() method, to check if a photo filename set in Image1 is a real
one. Cause if a photo does not exist, the Design studio put by default a small black cube inside Image.
Unfortunatelly these tests are not working .
My script:
var filename =  URLlink + empnb + ".png";    // existing employee photo
var filename0 = URLlink + "00000000" + ".png";  // dummy profile photo
IMAGE_1.setImage(filename); //Try to put a photo found on the server 
var height = IMAGE_1.getHeight(); 
if (height == -1)
{ IMAGE_1.setImage(filename0);   }
else   {IMAGE_1.setImage(filename);}
Does anyone have other idea how to test if a photo exist or not in my folder.
Many thanks!
Bea

I do not think it is possible today (at least not via checking of the image size). Such function would require
* code extension in image component -> boolean IMAGE.exists()
or
* could be made by custom image implementation via design studio SDK. This custom image would send a request via Ajax and check response status. in case not existing some dummy images would be placed.
for both options there are no plans as of today.
the only option I see today is to generate in the folder "dummy" images for all employes who do not have any real image.

Similar Messages

  • How to know when a topic does not exist

    I have an app that is created with Visual Studio 6, which
    does not have native support for HTML help (upgrading VS is
    currently not an option). I have an HTML help that I would like to
    call from my app. I need to call the html help with a context id
    number. Since there is no html help calls in this version of VS, I
    am calling hh.exe directly using ShellExecute ("hh.exe -mapid
    <id> <chm file>"). I dont know of any other way. The
    problem I am having is that there are times when my app and the
    help may be out of sync. It is possible that my app will call the
    help with an id that does not exist in the help. In WinHelp, the
    user would get a message indicating that the topic did not exist.
    Unfortunately, hh.exe does not return any messages. This makes the
    users think something is wrong with the app.
    Am I doing this the right way? Is there a way to find out if
    a topic exists and notify the user if it does not?
    Thanks in advance for you help.
    LA

    Hi LAYALA,
    We also develop with Visual Studio 6. You can override the
    WinHelp calls and redirect to HtmlHelp. Our app was originally
    developed using WinHelp. We made the change to HTMLHelp several
    years back and my developer claims it only took one line of code,
    though he's never told me what that line is. If nobody enters into
    this forum, I'll ask him tomorrow. I'm on Paciifc time so it will
    be quite a few hours from now.
    John

  • Please help: Two-Sided One-to-One Mapping issues warning when owned instance does not exist

    Hello,
    Is it expected behavior? I have two classes A and B, B references A and its
    foreign key column is its PK
    A owns B (marked as inverse-owner in JDO metadata) when I access A.getB() if
    B does not exist I get a warning.
    Is it to be expected? Does two sided relation always require presence of
    both sides of the relation and does nto fit my need?
    Is there any way to have bi-directional association in my case with owned
    record being optional?
    Should I use two simple one sided one-to-one or may be simple one sided from
    child to owner and One-to-One with Inverse Columns from owner to child
    What are disadvantages of using two one sided (simple and inverse) vs.
    two-sided?
    Thank you
    Alex

    Here is what I had to do to solve this issue:
    Basically I had to add the MSSQL TCP/IP port as an end-point in Azure. After I did that, then I was able to create the data-source. However, I was only able to authenticate with a SQL account, as any domain account would return me an error saying that the
    domain isn't trusted.
    What puzzles me here is how come the Data Source Manager would inform me that an account username/password was invalid, but it would fail/timeout if I provided valid credentials (!?!?!!?)

  • Conflicts in DOE when the object does not exist in CDS.

    Hi all.
    SCENARIO:
    I have implemented a SWCV with only a DO ( backend triggered). It has a Node structure with only one child structure.
    My DO has three function:
    - GETLIST:  return a table with objects from R3  identified by WCRN.
    - GETDETAIL: For each register from getlist, return a list of child registers with state : IMP or SEÑ.
                        This state in R3 may be IMP, SEÑ o NORM (but in devices, only I want them in state IMP o SEÑ)
    - MODIFY: modify the state for a child register.
    EXAMPLE:
    For example, I create a parent object in R3 with 3 children registers with state IMP. This parent register with his three children registers are upload to CDS.  When I syncronize, I obtain them in my device.
    PROBLEM:
    The problem starts when I modify the state to NORM of any child register in R3.  Then, in DOE, this child register is deleted in CDS becouse as I have said before, the function GETDETAIL only returns registers in state IMPS o SEÑ. Automatically the queue
    of my device is update too. Before syncronize my device, I change the state to SEÑ of the tree children registers in PDA. Then when I syncronize, the process tries to update then in CDS but one of this child register does not exist in DOE so I obtain the error text below in DOE:
    Mesage: "Cannot update/delete object that does not exist in the CDS; node 'ZMOB_DESC_ETIQUETA' "
    Service Name:  KEYMAP_SERVICE_BV  And in my Device, the child which generated the conflict does not exist (this is oK) but I continue having the others two children registers with the same state that I modified before syncronizing (SEÑ) while in R3 those two states are IMP.
    I have tested to modify the 3 posibilities of conflict detection scheme of the DO but the problem continues.
    I would like to know if there is any posibility or configuration to obtain the next scenario:  when this conflict will occurs, GETDETAIL will run and depending on which source will have preference:
    1- DEVICE PREFERENCE - the state from children registers in R3 will be updated to SEÑ.
    2 - R3 PREFERENCE - the state from my children registers in the device will be the same as in R3 (IMP).
    but never never never  never will happens like now ( differente state in R3 and PDA after syncronizing)
    Best regards
    Edited by: Maria Elena Fernandez on Feb 10, 2010 12:52 PM

    Hi again Oliver.
    Are you sure that ROW-LEVEL Conflict handling should detect the row with conflict and download the others two child register trought GETDAIL?
    I've just checked it again but it continues without working. After the conflict, none child is downloaded to my device.
    According to your two opcions:
    1- Imposible to avoid that.  It's a customer's requirement that they can modify states by R3 and Devices.
    2- Imposible too becouse we've already implemented the swcv in a production scenario. The application is already running and to change the model suppose a long time.
    I explain you the scenario again with an graphical example:
    INIITIAL STATE:  ( Device)
    parent structure :  ID1(key), date,                                 
    child structure:        ID1, 1, IMP (status)                                 
                                            ID1, 2, IMP (status)                                
                                            ID1, 3, IMP (status)                                 
    INITIAL STATE ( R3).
    ID1(key), date, ....
      -  ID1, 1, IMP(status)
      -  ID1, 2, IMP(status)
      -  ID1, 3, IMP (status)
    After this, I modified in R3->   ID1, 1, IMP  to  ID1, 1, NOR
    Then, GETDETAIL starts and deletes that register in DOE.
    Now I change the 3 children register in Device
      ID1, 1, IMP     -->  ID1, 1, SEÑ                                       
      ID1, 2, IMP     -->  ID1, 2, SEÑ                                   
      ID1, 3, IMP     -->   ID1, 3, SEÑ          
    After I syncronice,  FINAL STATE ( Device)
    parent structure :  ID1(key), date, ....                             
         child strucuture:                                                                               
    - ID1, 2, SEÑ (status)                             
                                     - ID1, 3, SEÑ (status)            
    FINAL STATE ( R3)
       ID1(key), date, ....
            -  ID1, 1, NORM(status)
            -  ID1, 2, IMP(status)
            -  ID1, 3, IMP (status)
    And that is the problem, different states between R3 and device.   I should need that the state in device for the others two children will be also IMP if R3 has preference or the two children will be SEÑ in R3 if the device has preference. But Now neither children in R3 nor children in Device are updated . Only the first which generate the conflict is deleted from device ( normal because it was still in the queue from the device before syncronice.
    Best regards.
    Edited by: Maria Elena Fernandez on Feb 11, 2010 8:32 AM
    Edited by: Maria Elena Fernandez on Feb 11, 2010 8:43 AM

  • ZCM 11.2.3a Image upload error [directory does not exist]

    We are uploading a number of images to the server.
    A lot of these are large images and the workstation has been build as a VMWare workstation.
    So far with the exception of one, all have uploaded successfully.
    One image is failing to upload when it is about halfway through. The error displayed on the workstation says "Directory not found"
    Looking at the novell-pbserv.log I see the following error message related to the image upload.
    RWCC unknown compression command code: 0x4000000 (67108864)
    RIP2 RWCC faiolure 3, 1851,
    Any help /ideas appreciated.
    Thanks
    Mark

    Hi Shaun,
    No we are using the the ZCM 11.2 pxe boot files.
    Although we have upgraded to ZCM 11.2.3a the image files from 11.2.3.a and the latest October Imaging update are crashing.
    I did post on the forums regards this and have a SR open for it. # 10865188291
    We are testing an upload of this particular image for the 3rd time. The other images have uploaded without issues.
    They have run a defrag on the disk prior to uploading.
    Regards
    Mark

  • SharePoint Calendar "List does not exist " when new item

    Hello Everybody,
    The scenario is as follows:
    I added a new list called "Calendar" and I created a new view to put it in a subsite. Then I did the following process in SPD:
    After creating the list I went to the "Web Part" and exported it as a file, then I inserted into SharePoint as a web part.
    Everything was ok so far. When I tried to add an event / Item to the calendar,  it displays a message that says the list does not exist.
    ***************ERROR:
     List does not exist.
    The page you selected contains a list that does not exist.  It may have been deleted by another user.<nativehr>0x81020026</nativehr><nativestack></nativestack>
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Runtime.InteropServices.COMException: List does not exist.
    The page you selected contains a list that does not exist.  It may have been deleted by another user.<nativehr>0x81020026</nativehr><nativestack></nativestack>
    This happend because i'm trying to add this web part in another subsite.
     Thanks in advance.

    Hi,
    This issue is due to that the WebId property in the exported web part file is not referring to the web where the list exists.
    I recommend to edit the exported file and then search for “WebId”, and then change the value to the GUID of the web where the list exists.
    To get the GUID of the web, use this command: Get-SPWeb -site http://yoursitecollectionURL | select URL,ID.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • How to handle missing data when a limit value does not exist

    Hi guys
    I am quite new to all this OLAP stuff and I don't know how to detect the following situation:
    What happens when CREDITT.MYSERIES2 does not exist? the query then returns V1 and V2 populated with the data from CREDIT.MYSERIES1 and CREDIT.MYSERIES3 respectively (and V3 being all NULLs). I have no way of knowing that the limit has not worked on Series2.
    Is there any way to detect this? (perhaps assigning V2 to be all NULLs?)
    Thanks in advance
    Adam
    SELECT
         TRUNC(IND-TO_DATE('01011900','ddmmyyyy')+2),V1,V2,V3
         FROM (                     
              SELECT *                     
              FROM TABLE(                          
                   OLAP_TABLE( 'OLAPFAME.MAG_CRD DURATION SESSION',
                                  'DIMENSION IND AS DATE FROM DAY
                                  MEASURE V1 AS NUMBER FROM AW_EXPR DAILY.DATA(SERIES STATVAL(SERIES, 1))
                                  MEASURE V2 AS NUMBER FROM AW_EXPR DAILY.DATA(SERIES STATVAL(SERIES, 2))
                                  MEASURE V3 AS NUMBER FROM AW_EXPR DAILY.DATA(SERIES STATVAL(SERIES, 3))
                                  ROW2CELL R2C1' ))                          
              MODEL                               
                   DIMENSION BY(IND)                               
                   MEASURES(V1,V2,V3,R2C1)                               
                   RULES UPDATE SEQUENTIAL ORDER())
         WHERE OLAP_CONDITION( R2C1,
                                  'LIMIT SERIES TO ''CREDIT.MYSERIES1'',
                                                 ''CREDITT.MYSERIES2'',
                                                 ''CREDIT.MYSERIES3'';
                                  LMT DAY TO ''21DEC2009'' TO ''31DEC2009'';
                                  LMT DAY REMOVE DAYOF(DAY) EQ 7 OR DAYOF(DAY) EQ 1',
                                  1 )=1

    I am not sure what your issue is entirely because what you posted is not your working code.
    WHERE OLAP_CONDITION( R2C1,
    'LIMIT SERIES TO ''CREDIT.MYSERIES1'',
    ''CREDITT.MYSERIES2'',    <-- this seems incorrect
    ''CREDIT.MYSERIES3'';    <-- semicolon indicates end of statement
    LMT DAY TO ''21DEC2009'' TO ''31DEC2009'';  <-- what is this?
    LMT DAY REMOVE DAYOF(DAY) EQ 7 OR DAYOF(DAY) EQ 1', <-- what is this?
    1 )=1Could you please repost the correct code?

  • Search help does not work when view context is mapped to comp context

    Hello,
    I am trying to display search help for an input field of a view. The context to which the input field is bound is a node with an attribute. I have specified Dictionary Search help for the attribute. Now when I execute the application, I am able to get the search help in the screen.
    But, I  need to map this  view context node to its comp controller context. When I do the mapping, the search help does not appear when executed.
    It would be a great help if someone can point out an answer to this.
    Thanks,
    Maya

    Hi Maya
    Follow these steps:
    1.Delete the context node/attribute which is bound to search help from the View.
    2.Now Save metadata.
    3.Perform Context mapping again .In the Edit Context Mapping window drag the node/attribute FROM RIGHT PANE TO LEFT PANE and select the entry.
    4.Delete the Input Field from the view.
    5.Save again
    6.Close NWDS and reopen it.
    7.Create input field again and bind it to the context element.
    Hope this solves the problem.
    Regards
    Ananda

  • "file does not exist on remote server" when uploading image

    As the title says, when uploading an image im getting the
    message "file does not exist on remote server"......yet dreamwever
    has uploaded the file, its there. All other pages on my website
    work fine when uploading images. Any ideas?

    What image type is it? Is it in an images folder or the root
    directory? It would be helpful to post a link.

  • Account error: value does not exist in BB Company is displayed when Uploading a Journal to Oracle ADI Interface Table

    Environment:
    Oracle ADI version: version Oracle ADI 7.2.12.04.25 and patch number 9493800
    Microsoft Office version: 2003
    How to recreate incident:
    1. Create a budget worksheet for a company
    2. View the budget information
    3. Upload budget information to the Interface Table
    Actual Result:
    Account error: Value <value> for the flexfield COMPANY does not exist in the value set BB_COMPANY. I have noticed the same error is displayed regardless of whether I select options from the combo boxes or enter random numbers in the journal i.e. 0000 for each field.
    Expected Result:
    Budget information to be uploaded successful especially when the data has not been amended
    Questions:
    1. What is happening to cause this problem?
    2. What is the solution?

    The issue is resolved, no need to answer, the dbconnection class was calling the wrong db :(

  • I just installed the new firefox for Mac OSX 10.6.8 and when I select an image on a site (right click and copy) and paste in Photoshop 5.5, the image lightens. It does not do this in Safari.

    Question
    I just installed the new firefox for Mac OSX 10.6.8 and when I select an image on a site (right click and copy) and paste in Photoshop 5.5, the image lightens. It does not do this in Safari.

    Firefox, Safari, and PhotoShop each handle embedded color profiles differently. For an add-on that makes it easier to experiment with Firefox's color management options, you might be interested in: [https://addons.mozilla.org/en-US/firefox/addon/color-management/ Color Management :: Add-ons for Firefox]. I haven't tried it myself.

  • Photos does not display generic title of image (ex: IMG_2234) as actual title. Is there a way to batch rename all photos using the generic title?

    Photos does not display generic title of image (ex: IMG_2234) as actual title. Is there a way to batch rename all photos using the generic title?

    If you launch Script Editor and open the Help menu, you will see the APpleScript Help and a Language Guide:
    To see, which commands an application understands, open the File menu in Script editor and select Open Dictionary.  In the list locate "Photos".
    You will see examples how o script Photos.

  • How to update zero to a column value when record does not exist in table but should display the column value when it exists in table?

    Hello Everyone,
    How to update zero to a column value when record does not exist in table  but should display the column value when it exists in table
    Regards
    Regards Gautam S

    As per my understanding...
    You Would like to see this 
    Code:
    SELECT COALESCE(Salary,0) from Employee;
    Regards
    Shivaprasad S
    Please mark as answer if helpful
    Shiv

  • When I type key words and click search it does not open

    When I type keywords in search, it does not open. Browser bar has go to website.

    Home page Mozilla search bar. Browser does not change to the URL. It show only 'go to website'

  • My search box does not display suggestions even though it is set to (it displays past searches, but not suggestions). I have looked at the FAQs and everything is set for it to show suggestions.

    My search box does not show suggestions although it is set to show suggestions.

    MMS is a carrier issue... contact Verizon and ensure your account is provisioned correctly.  I would think that someone would be intelligent enough to do that before buying a new device, but......
    iMessage could be an activation issue or a network issue.
    Have you tried Settings > General > Reset > Reset Network Settings?
    Does iMessage work consistently on Wi-Fi?

Maybe you are looking for