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.
- 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
- 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.
- Create a new dynamic action:
Event: Change
Selection Type: jQuery selector
jQuery Selector: #change-tabular select[name="f21"]
- 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());
- 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.