Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.3
-
Unknown
-
Description
The custom display of the "target" field currently has two cases:
- edit mode
- other modes (display a HTML link)
This forgets the hidden mode in which the HTML link is incorrect. It should display a hidden input for forms.
I suggest the following code in the custom display:
{{velocity}} #set ($propertyClass = $object.getxWikiClass().get($name)) #if ($type == 'edit') {{html clean="false"}}$doc.displayEdit($propertyClass, $prefix, $object){{/html}} #elseif ($type == 'hidden') {{html clean="false"}}$doc.displayHidden($propertyClass, $prefix, $object){{/html}} #else #if ("$!value" != '') #set ($reference = $services.model.resolveDocument($value)) #set ($target = $xwiki.getDocument($reference)) #set ($url = $xwiki.getURL($reference)) {{html clean="false"}}<a href="$escapetool.xml($url)">$escapetool.xml($target.displayTitle)</a>{{/html}} #end #end {{/velocity}}
Attachments
Issue Links
- is related to
-
XAWORKFLOW-94 Display target field as a link on view instead of plain text
- Closed