我正在使用Oracle Apex中的一个应用程序。我有一个“仅显示”项,该项是通过使用“动态操作”并通过以下PL / SQL函数体设置值来构建的
DECLARE
v_message varchar2(1000);
v_notification varchar2(10000);
BEGIN
FOR item IN
(SELECT * FROM NOTIFICATIONS)
LOOP
v_message := item.notification_msg || chr(10) || chr(10);
v_notification := v_notification || v_messsage;
END LOOP;
return v_notification;
END;
问题在于换行符在呈现的页面中被忽略。你能告诉我如何显示带有换行符的项目。
让Notifications表格像这样
ID NOTIFICATION_MSG
1 Last date for the application is 18th Dec.
2 Office closed from 25th dec to 1st Jan.
我希望页面中呈现的“仅显示项目”为
Last date for the application is 18th Dec.
Office closed from 25th dec to 1st Jan.
但是它呈现为
Last date for the application is 18th Dec.Office closed from 25th dec to 1st Jan.
截至chr(10) || chr(10)
:你的意思是chr(13) || chr(10)
相反吗?
无论如何:包含<br>
一个换行符,例如
v_message := item.notification_msg || '<br>'
不要忘记为该显示项将转义特殊字符设置为“否”。
我已经尝试了您所说的内容,将Escape特殊字符设置为“否”,并且还使用<br>作为换行符。但是<br>字符只是作为普通文本呈现,而不创建换行符,即对于问题中提到的示例,它被呈现为
Last date for the application is 18th Dec<br>.Office closed from 25th dec to 1st Jan.<br>
我在Apex 18.2上进行了尝试,并且可以正常工作...在发布答案之前对其进行了测试。
不知道为什么,但是现在可以正常工作了。谢谢