<div>Thank you Julian, once again.<br></div><div><br></div><div>That's another fine mess you've got me out of!</div><div><br></div><div>Kind regards</div><div><br></div><div>Johnathan</div><br><div class="gmail_quote">
On 6 December 2011 09:23, Julian Tenney <span dir="ltr"><<a href="mailto:Julian.Tenney@nottingham.ac.uk">Julian.Tenney@nottingham.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">





<div>
<div style="FONT-FAMILY:Tahoma;DIRECTION:ltr;COLOR:#000000;FONT-SIZE:x-small">
<div>Fay is right: you are getting the string "FileLocation + 'media/file.jpg'", you need to evaluate it.</div>
<div> </div>
<div><font face="tahoma">myPath = expression(templateData.pageName[0].icon, engine); //substitute your page name / attribute name</font></div>
<div><font face="tahoma">debug(myPath);</font></div><div class="im">
<div dir="ltr"> </div>
<div style="DIRECTION:ltr">
<hr>
<font color="#000000" size="2" face="Tahoma"><b>From:</b> <a href="mailto:xerte-bounces@lists.nottingham.ac.uk" target="_blank">xerte-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-bounces@lists.nottingham.ac.uk" target="_blank">xerte-bounces@lists.nottingham.ac.uk</a>] On Behalf Of Kemp Johnathan [<a href="mailto:johnathan.kemp@ntlworld.com" target="_blank">johnathan.kemp@ntlworld.com</a>]<br>

<b>Sent:</b> 05 December 2011 22:19<br>
<b>To:</b> Xerte discussion list<br>
<b>Subject:</b> [Xerte] rootIcon.loadIcon() - getting it working with xml<br>
</font><br>
</div>

</div><div><div class="h5"><div>
<div>The Xerte help specifies <br>
</div>
<div><br>
</div>
<div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">rootIcon.<font style="BACKGROUND-COLOR:#0a246a" color="#ffffff">loadIcon</font>(FileLOcation + 'media/icon.png');</span></font></div>

<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">as the way to call loadIcon, but how do you use it when you don't want to hard code the file name?<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">I have an xwd based form that collects the url value as
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">"FileLocation + 'media/bannerTest1.png'"<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">In my script I have tried<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">rootIcon.loadIcon(templateData.learningObject[0].projDisplay[0].logoUrl);<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">which fails, even though
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">debug(</span></font>
<font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">templateData.learningObject[0].projDisplay[0].logoUrl</span></font>
<font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">);<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">outputs <br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">FileLocation + 'media/bannerTest1.png'<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">I have tried tests such as <br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">fred = "media/bannerTest1.png";<br>
rootIcon.loadIcon(FileLocation + "'" + fred + "'");</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">and</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">fred = "'media/bannerTest1.png'";<br>
rootIcon.loadIcon(FileLocation + fred);<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
In an attempt to figure out what hoops I will have to go through to get it to work, but the only way I can get the image to display is if I hard code it into the script.
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">i.e.<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">rootIcon.loadIcon(FileLocation + 'media/bannerTest1.png');<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">works.<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">I cannot get the image to display when the path is passed in a variable.</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">I don't know if the issue is something to do with FileLocation converting to a path with back slashes whilst the media/bannerTest1.png has a forward slash, but this hasn't stopped
 the method call working when I hard code the file name.<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">Can anyone suggest a way forward?<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">Kind regards<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt">Johnathan<br>
</span></font></div>
<div align="left"><font size="2" face="Andale Mono"><span style="FONT-SIZE:10pt"><br>
</span></font></div>
</div>
</div>
</div></div></div><div class="im">
<br>
<p>
This message and any attachment are intended solely for the addressee and may 
contain confidential information. If you have received this message in error, 
please send it back to me, and immediately delete it.   Please do not use, 
copy or disclose the information contained in this message or in any attachment.  
Any views or opinions expressed by the author of this email do not necessarily 
reflect the views of the University of Nottingham.
</p>
<p>
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
</p>
</div></div>


<br>_______________________________________________<br>
Xerte mailing list<br>
<a href="mailto:Xerte@lists.nottingham.ac.uk">Xerte@lists.nottingham.ac.uk</a><br>
<a href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte" target="_blank">http://lists.nottingham.ac.uk/mailman/listinfo/xerte</a><br>
<br>
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.<br>

<br>
This message has been checked for viruses but the contents of an attachment<br>
may still contain software viruses which could damage your computer system:<br>
you are advised to perform your own checks. Email communications with the<br>
University of Nottingham may be monitored as permitted by UK legislation.<br>
<br>
<br></blockquote></div><br>