Forum Stats

  • 3,780,546 Users
  • 2,254,409 Discussions
  • 7,879,377 Comments

Discussions

How to get a selected row column values in interactive gird?

User_DXKQF
User_DXKQF Member Posts: 2
edited Feb 11, 2021 6:00AM in APEX Discussions

I want to get values form selected row using variables.

Tagged:

Answers

  • BobR
    BobR Member Posts: 41 Blue Ribbon

    Don't quite know what you mean by 'variables'. But here is an easy way to put selected row values into a page item:

    create a page_item (mine is named P27_SELECTED_ROWS).

    create a dynamic action and in the when section select 'when selection changes (interactive grid)'

    create a true action and set the Identification to 'execute javascript code'.

    Add the code:

    var i, i_empids = ":", i_empid,

    model = this.data.model;

    for ( i = 0; i < this.data.selectedRecords.length; i++ ) {

          //  i_empid = model.getValue( this.data.selectedRecords[i], "LOCN_TASK_TIME_ID");

        i_empids += model.getValue( this.data.selectedRecords[i], "LOCN_TASK_TIME_ID") + ":";

    }

    apex.item( "P27_SELECTED_ROWS" ).setValue (i_empids);

    //apex.item( "P27_SELECTED_ROWS" ).setValue (i_empid);

    this code shows the variable i_empids being populated with a starting ':' and then the LOCN_TASK_TIME_ID and another ':'. All the rows are collected and put into P27_SELECTED_ROWS. If you only have one row to read then use i_emp_id.

    I have process that parses P27_SELECTED_ROWS and does the work of putting the data into the database.

    Bob R