在Oracle Apex交互式网格中显示与字段内联的错误消息 [英] Display error message inline with field in Oracle Apex interactive grid

查看:227
本文介绍了在Oracle Apex交互式网格中显示与字段内联的错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

验证失败后,我尝试将错误消息添加到交互式网格.我遵循了表格形式的apex_error.add_error过程的文档,但无法获得错误消息以在交互式网格中与字段一起内联显示.

I tried to add error message to an interactive grid after validation fails. I followed the documentation for apex_error.add_error procedure for tabular forms, but I could not get the error message to display inline with field in the interactive grid.

我尝试使用数字格式和varchar格式的区域ID,以及使用数据库中的列名称和浏览器上显示的名称的列别名和列别名.我也正在考虑仅在通知中显示消息,并添加JavaScript以将通知复制到某处,但是我不太确定该怎么做.页面上的html看起来像这样:

I tried the region id with the number format and varchar format, and column alias name with the column name in the db and name that is displayed on the browser. I am also thinking to display the message only in notification and add javascript to copy the notification somewhere, but I am not very sure how to do that. The html on the page looks like this:

<li class="a-Notification-item htmldbStdErr"> ::before "java.sql.SQLSyntaxErrorException: ORA-00904: "LEDGER1_NAME": invalid identifier for SEC_OBJ_CODE= erwq"
</li>

 APEX_ERROR.ADD_ERROR( p_message          => apex_json.get_varchar2('Message')||' for SEC_OBJ_CODE= ' ||:SEC_OBJ_CODE,
    p_display_location =>  apex_error.c_inline_with_field_and_notif,
    p_region_id   => '3104734890213506',
    p_column_alias => 'Sec Obj Val Sql',
    p_row_num  => :ROWID); 

我得到的错误是:

Ajax调用返回了服务器错误ORA-20987:APEX- 错误处理验证. -与您的应用程序管理员联系.

Ajax call returned server error ORA-20987: APEX - Error processing validation. - Contact your application administrator.

推荐答案

要在交互式网格的列上创建验证并显示与该列关联的错误消息,请执行以下操作:

To create a validation on a column of the interactive grid and display an error message associated with the column, do as follows:

  1. 在页面设计器模式下,搜索交互式网格区域,展开列"部分,然后右键单击要验证的列,然后单击创建验证":

  1. 现在,您可以使用"验证"部分下的类型来构建验证;
  2. 在"错误"部分下,您可以编写错误消息,将"显示位置"设置为"插入字段"或"与字段内联并在通知中"和与要验证的列"关联的列"(此字段将被填充).
  1. Now you can build your validation using Type under "Validation" section;
  2. Under "Error" section, you can write your error message, set "display location" to "Inline with field" or "Inline with field and in notification" and "associated column" with the column you are validating (this will be filled already).

这篇关于在Oracle Apex交互式网格中显示与字段内联的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆