Set Column Value

Cancel Delete Submit
(null)
2442
2443
2481
1941
2043
2001
2261
2321
2521
2441
Next
Add Row

Get Column Value

EmpnoEnameEdit
7839KING
7698BLAKE
7782CLARK
7566JONES
7788SCOTT
7902FORD
7369SMITH
7499ALLEN
7521WARD
7654MARTIN
7844TURNER
7876ADAMS
7900JAMES
7934MILLER
  • 1 - 14

Instructions

This demonstrates getting and setting the value of a column that is not the one the browser event occured from. See the following relative problems: https://forums.oracle.com/forums/thread.jspa?messageID=10181644 and https://forums.oracle.com/forums/message.jspa?messageID=10016482. The instructions below are related to getting the item value, but setting the value is just a matter of passing a value into the val function.

  1. Give the tabular form a static ID to ensure our jQuery selector matched only elements from within the form region. I called it: change-tabular
  2. Figure out the name attribute of the column that should fire the action. I specifically set it to f21 for the drop down list that we want to fire the action.
  3. Create a new dynamic action:
    Event: Change
    Selection Type: jQuery selector
    jQuery Selector: #change-tabular select[name="f21"]
  4. True Action: Execute JavaScript Code
    Code: (otherElement is the variable that the gets the vale of the other column - update the name attribute to refer to the column you want to get)
    
    var row = $x_UpTill(this.triggeringElement, 'TR');
    var otherElement = $('input[name="f20"]', row);
    
    alert("Action: " + this.triggeringElement.value + "\rPK: " + otherElement.val());
    
    
  5. It is important to update the dynamic action and specify the Event Scope as Dynamic, so that and additional rows that are added are still affected.