Display error message inline with field in Oracle Apex interactive grid

梦想的初衷 提交于 2019-12-11 14:35:43

问题


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.

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); 

The error I got is:

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


回答1:


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

  1. On page designer mode, search for you interactive grid region, expand the columns section and right click the column that you want to be validated and click create validation:

  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).


来源:https://stackoverflow.com/questions/57100939/display-error-message-inline-with-field-in-oracle-apex-interactive-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!