hinotf
hinotf

Reputation: 1138

Pass column classic report value to PL/SQL

I have page with Classic Report on it (type = PL/SQL Dynamic Content). What I need it's passing one column value to PL/SQL via Dynamic Action when click on another column. It's no problem to initiate click action, but I don't know how to pass equivalent of #col_name# (not :Pxxx_item_name) to PL/SQL.

pass first column value into pl/sql procedure when click on third column

Application Express 5.0.4.00.12

Upvotes: 0

Views: 4600

Answers (1)

eaolson
eaolson

Reputation: 15094

I'm not sure what you're trying to pass, so I'm just going to call it "item".

  1. In your report add a custom data attribute to the column, data-item="#COL_NAME#". This would go on the image that's getting clicked. You might need to use the HTML Expression option to set this.
  2. Create a hidden item, P1_ITEM and set Value Protected to No.
  3. Create a Dynamic Action that fires when you click the image in the column.
  4. Create a True action on that DA, Action = Set Value, Set Type = Javascript Expression, the JS expression is this.triggeringElement.dataset[ "item" ], Affected Element > Selection Type = Item, Item = P1_ITEM.
  5. Create another True action on that same DA, Action = Execute PL/SQL Code, Items to Submit = P1_ITEM, and whatever code you want in the PL/SQL code section. You can reference P1_ITEM in your code with :P1_ITEM or V('P1_ITEM').

When the DA fires, it will populate the column value into P1_ITEM, then submit that to the server where it's stored in session state, then run your PL/SQL code.

Upvotes: 1

Related Questions