I have a field in my database with a URL I want to create a link to like
this:
<A href="urlAddress">urlAddress</A>.
I got this to work using the UserDefinedHtml property of the display field.
This seems to work just fine, and when urlAddress is blank, nothing is
displayed, and no link appears on the page. Good.
If I wanted to use another display field in place of the urlAddress link
text, <A href="urlAddress">linkTextField</A>, then this doesn't work.
I was wondering how to do this using Java.
Here is the code I used for the WebPage display field:
//[[SPIDER_EVENT<WebPage_onBeforeDisplayEvent>
public int Manufacturer_onBeforeDisplayEvent(CSpDisplayEvent event)
{
CSpSelect doMfr=(CSpSelect) CSpider.getDataObject("DoManufacturer");
CSpValue urlAddress = doMfr.getValue(0,"WebPage");
CSpValue mfrName = doMfr.getValue(0,"Manufacturer");
if(urlAddress.isNull()){
setDisplayFieldValue("WebPage", new CSpString(""));
}
else {
setDisplayFieldValue("WebPage", new CSpString("<A href=\"" +
urlAddress + "\">" + mfrName + "</A>"));
}
return (PROCEED);
}
//]]SPIDER_EVENT<Manufacturer_onBeforeDisplayEvent>
This, however, interprets my '<' and quotes incorrectly and the html that is
generated lookes like this:
<A
href="http://www.analog.com/index.html">http://www.analog.com/i
ndex.html</A>
The <, ", and > is my problem.
Can anybody help me with the solution?
Thank you,
John
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]