GET_ELEMENT_ATTRIBUTES Function

This function returns some of the standard attributes of an HTML element (for example, id, name, required, placeholder, aria-error-attributes, class) which is used if a HTML input/select/textarea/... tag is generated to get a consistent set of attributes.

Syntax

APEX_PLUGIN_UTIL.GET_ELEMENT_ATTRIBUTES (
    p_item           IN APEX_PLUGIN.T_PAGE_ITEM,
    p_name           IN VARCHAR2 DEFAULT NULL,
    p_default_class  IN VARCHAR2 DEFAULT NULL,
    p_add_id         in boolean  default true )
    return varchar2;

Parameters

Table 19-21 describes the available parameters for GET_ELEMENT_ATTRIBUTES function.


Table 19-21 GET_ELEMENT_ATTRIBUTES Function Parameters

Parameters Description

p_item

This is the p_item parameter of your plug-in function.

p_name

This is the value which has been return by apex_plugin.get_input_name_or_page_item

p_default_class

Default CSS class which which should be contained in the result string.

p_add_id

If set to TRUE then the id attribute is also contained in the result string.


Example

This example emits an INPUT tag of type text which uses apex_plugin_util.get_element_attributes to automatically include the most common attributes.

sys.htp.prn (
        '<input type="text" ' ||
        apex_plugin_util.get_element_attributes(p_item, l_name, 'text_field') ||
        'value="'||l_escaped_value||'" '||
        'size="'||p_item.element_width||'" '||
        'maxlength="'||p_item.element_max_length||'" '||
        ' />');