This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Feb 6, 2012, 7:14 PM
27 Posts

xp:image url with no database

  • Category: Server Side JavaScript
  • Platform: Not Applicable
  • Release: 8.5.2
  • Role: Developer
  • Tags: controls tags image
  • Replies: 1
Good day everyone!
 
I'd like to use the xp:image control with a relative image but have it not automatically append the database to the beginning of the URL.  Specifically, I have something like so:
 
<xp:image id="completeFlag"> 
    <xp:this.url><![CDATA[#{javascript:
        var isComplete = doc.getItemValueString('IsComplete');
        var img = '/interface/img/icon-red_x.gif';
        if(isComplete!=null && isComplete=='true') {
        img = '/interface/img/icon-green_check.gif';
        }
        img;
}]]></xp:this.url>
</xp:image> 
 
...which is rendering an image tag like: 
 
<img src="/myDatabase.nsf/interface/img/icon-red_x.gif" id="completeFlag" />
 
Is there any way to make it not append the database ('/myDatabase.nsf')? 
 
Many thanks for any help! 
Cheers, 
 
Feb 7, 2012, 3:01 PM
272 Posts
Re: xp:image url with no database
Hi,
 
you could specify the full url:
 
<xp:image id="completeFlag">
   <xp:this.url><![CDATA[#{javascript:
      var img = 'http://localhost/interface/img/icon-red_x.gif';
      img;
   }]]></xp:this.url>
</xp:image>
 
Hope this helps
Sven
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal