このプロシージャはSession State
を拡張して、特定の行番号の列値を含めます。これにより、substitution syntax
またはV
ファンクションを使用して、ページまたはアプリケーション・アイテムを参照するのと同じ方法で列を参照できます。
注意:
apex_plugin_util.clear_component_values
は常に、現在の行の処理が完了してからコールしてください!
構文
procedure set_component_values ( p_column_value_list in t_column_list, p_row_num in pls_integer );
パラメータ
表21-42 SET_COMPONENT_VALUESのパラメータ
パラメータ | 説明 |
---|---|
|
|
|
|
例
この例は、提供されたSQL問合せに基づいてリンク・リストをレンダリングする、単純なアイテム・タイプのプラグイン・レンダリング・ファンクションを選択したものです。最初の列にリンクが含まれ、2番目にリンク・ラベルが含まれる固定されたSQL問合せ形式ではなく、開発者はこのプラグインを使用して任意のSQL文を入力し、置換構文を使用して実行されたSQL問合せの値を参照できます。
function render_link_list ( p_item in apex_plugin.t_page_item, p_value in varchar2, p_is_readonly in boolean, p_is_printer_friendly in boolean ) return apex_plugin.t_page_item_render_result is -- The link target plug-in attribute 01 would allow that a developer can enter a link which references columns -- of the provided SQL query using subsitution syntax. -- For example: f?p=&APP_ID.:1:&APP_SESSION.::&DEBUG.::P1_EMPNO:&EMPNO. -- where &EMPNO. references the column EMPNO in the SQL query. c_link_target constant varchar2(4000) := p_item.attribute_01; -- The link label column plug-in attribute 02 would allows a developer to reference a column of the SQL query -- which should be used as the text for the link. c_link_label_column constant varchar2(128) := p_item.attribute_02; -- l_column_value_list apex_plugin_util.t_column_value_list2; begin l_column_value_list := apex_plugin_util.get_data2 ( p_sql_statement => ... ); -- sys.htp.p('<ul>'); for i in 1 .. l_column_value_list.count(1) loop -- Set all column values of the current row apex_plugin_util.set_component_values ( p_column_value_list => l_column_value_list, p_row_num => i ); -- sys.htp.p( '<li><a href="' || apex_escape.html_attribute( apex_util.prepare_url( c_link_target )) || '">' || apex_escape.html( v( c_link_label_column )) || '</a></li>'); -- apex_plugin_util.clear_component_values; end loop; sys.htp.p('<ul>'); end;