このファンクションは、一貫性のある属性セットを取得するためにHTMLのinput、select、textareaなどのタグを生成する場合に使用される、いくつかのHTML要素の標準属性(id、name、required、placeholder、aria-error-attributes、classなど)を戻します。
構文
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, p_add_labelledby in boolean default true ) return varchar2;
パラメータ
表21-22 GET_ELEMENT_ATTRIBUTESファンクションのパラメータ
パラメータ | 説明 |
---|---|
|
一貫性のある属性セットを取得するためにHTMLのinput、select、textareaなどのタグを生成する場合に使用される、HTML要素(ID、name、required、placeholder、aria-error-attributes、classなど)の一般属性をいくつか戻します。aria-labelledby属性の指定を必要としないHTMLの入力要素(input、select、textareaなど)をレンダリングする場合は、ラベルの 注意: aria-labelledbyの挿入は、「標準のフォーム要素」が「いいえ」に設定され、 |
|
これは、プラグイン・ファンクションのp_itemパラメータです。 |
|
これは、apex_plugin.get_input_name_or_page_itemによって戻される値です。 |
|
結果文字列に含む必要があるデフォルトのCSSクラス。 |
|
TRUEを設定すると、結果文字列にID属性も含まれます。 |
例
この例では、最も一般的な属性が自動的に含まれるように、apex_plugin_util
.get_element_attributes
を使用するテキスト・タイプのINPUTタグを生成します。
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||'" '|| ' />');