Warm tip: This article is reproduced from serverfault.com, please click

其他-如何在Oracle Apex的“仅显示”项中进行换行?

(其他 - How to make a linebreak in Display Only item in Oracle Apex?)

发布于 2020-12-07 05:33:24

我正在使用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.
Questioner
user9991
Viewed
0
Littlefoot 2020-12-07 15:21:18

截至chr(10) || chr(10):你的意思是chr(13) || chr(10)相反吗?


无论如何:包含<br>一个换行符,例如

v_message := item.notification_msg || '<br>'

不要忘记为该显示项转义特殊字符设置为“否”。