There's a field property in the studio, something like "Html escaping on",
values yes/no or true/false.

The default is that escaping is on, so that that each character in the
field value is literally presented to the user as its underlying value, and
not  interpreted as HTML code, which is what you want.  So flip to the
other value.

If you don't want to be dependent on you or somebody else remembering to
set this property, you can write code so that it doesn't matter:

A.  make your field static text if it isn't already.
B.  create a private String member variable in the page 
C.  instead of using setDisplayFieldValue, put the value into the String
member variable (at the same point in processing)
D.  put code something like this in the field's onBeforeHtmlOutput event:
                1.  CSpDisplayField field = (CSpDisplayField) event.getSource();
                2.  field.setHtmlText(_urlvaluestring); //argument is the member var 
that
holds the html for this field.

-- Curt Springer, Team NetDynamics

At 10:22 AM 4/30/99 -0600, Wehner, John wrote:
>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:
>
>&lt;A
>href=&quot;http://www.analog.com/index.html">http://www.analog.com/i
>ndex.html&lt;/A&gt;
>
>The &lt;, &quot;, and &gt; 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]
> 
_________________________________________________________________________

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]

Reply via email to