Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1682 closed defect (fixed)

HTML links in data fail to display correctly

Reported by: Martin Morrison Owned by: jng
Priority: high Milestone:
Component: AJAX Viewer Version: 2.2.0
Severity: critical Keywords:
Cc: External ID:

Description

With the AJAX viewer html anchor tags (hyperlinks) do not display correctly in the properties pane. In 2.02 hyperlinks worked. You could place html anchor tags in the data and they displayed as clickable hyperlinks in the properties window. With 2.2 I see the anchor tags in the properties window, not the links. There was a reference to this issue in this thread... http://osgeo-org.1803224.n2.nabble.com/Hyperlinks-in-Properties-pane-of-Ajax-viewer-td5480165.html When I look at what is coming to the browser in Firebug I see escaped data, e.g. &lt rather than <.

I have managed to get the links working, however now it does not comply with standard html practices. The half hack was to add the following line to propertyctrl.templ.

*LINE TO ADD

code = code.replace(/&lt;/gi,'<').replace(/&gt;/gi,'>');

The function to add it to is: SetProperties() It goes just before the line " SetContent(code);". This is a hack. It is NOT a correct fix. It should be passed correctly from the server. This does cause other issues. E.g. this does not decode quotes, spaces etc from URL's. In order for this to work I had to remove from my data quotes from the URL.

Old -> <a href="/propcards/036680.pdf" target="_blank">Click Here(PDF)</a>

New -> <a href=/propcards/036680.pdf target="_blank">Click Here(PDF)</a>

Both are valid HTML. MapGuide should be able to handle the quotes in the href= statement. We should not be doing a javascript hack and changing data to get this to work correctly.

Change History (5)

comment:1 by jng, 13 years ago

Component: GeneralAJAX Viewer
Owner: set to jng

comment:2 by steveg, 13 years ago

Under "other issues" caused by Martin's fix...it seems like all/most special characters breaks the hyperlink (I have "?" and "=" in my URLs and the hyperlink does not code properly).

comment:3 by Martin Morrison, 13 years ago

The ONLY characters fixed by the hack I did are: < and >

comment:4 by jng, 13 years ago

Resolution: fixed
Status: newclosed

Fixed r5884 (trunk) and r5885 (2.2)

comment:5 by Martin Morrison, 13 years ago

Thanks, I will test this as soon as I can.

Note: See TracTickets for help on using tickets.