Hi Alex,
Sorry I did not respond earlier, I don't know the answer off the top of my head. I had to do some research on this one.
I don't know of any way to disable the "entry" key in tables. It seems to be built-in.
The way to add more code to this is to add a task to the selection parameter. If you use w.selectionparam as a config option for your table, you can point it to a parameter that will hold the value of the selected row in the table (for structured parameters).
You can then add a task to that parameter. I.e. drop it in your panel, and add a task. When the table selection changes, that task triggers. Now that will trigger no matter if you change it with enter or if you change it in some other way (mouse clicks, etc). So it's not exactly the same. I made an example panel, which simply outputs a debug message when the selection changes. The code is at the bottom of this post.
I also gave my table an ID and added an "ogscript" block that triggers onKeyPress for that ID.

That tells me when Enter was pressed in the table, and I can do other stuff before the selection changes. If I want to do stuff after the selection changes, you have to use ogscript.asyncExec, and wait a little bit (I waited 20 ms). I hate those types of things though, because on some systems, the wait time may be bigger. So you have to be really careful about using those types of methods where you are waiting a specific amount of time. I prefer the method where you attach a task to the selection parameter. That one does not rely on some "magic number" timing.
Here is the code:
<abs contexttype="opengear" gridsize="20" keepalive="true">
<meta>
<params>
<param access="1" constrainttype="STRUCT" name="Clip Info" oid="templates.clipInfo" structtype="com.rossvideo.playinfo" type="STRUCT" widget="36">
<value>
<subparam access="1" maxlength="0" name="Clip Name" suboid="ClipName" type="STRING" value="Test" widget="0"/>
<subparam access="1" maxlength="0" name="Director" suboid="Director" type="STRING" value="Test" widget="0"/>
<subparam access="1" maxlength="0" name="Original Air Date" suboid="OriginalAirDate" type="STRING" value="Test" widget="0"/>
<subparam access="1" maxlength="0" name="Author" suboid="Author" type="STRING" value="Test" widget="0"/>
</value>
</param>
<param access="1" constrainttype="STRUCT" name="Clip Info" oid="params.clipList" structtype="com.rossvideo.clipinfo" templateoid="templates.clipInfo" type="STRUCT_ARRAY" widget="table">
<value>
<subparam suboid="ClipName" value="Winter is Coming"/>
<subparam suboid="Director" value="Tim Van Patten"/>
<subparam suboid="OriginalAirDate" value="April 24, 2011"/>
<subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>
</value>
<value>
<subparam suboid="ClipName" value="The Kingsroad"/>
<subparam suboid="Director" value="Brian Kirk"/>
<subparam suboid="OriginalAirDate" value="April 24, 2011"/>
<subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>
</value>
<value>
<subparam suboid="ClipName" value="Lord Snow"/>
<subparam suboid="Director" value="Brian Kirk"/>
<subparam suboid="OriginalAirDate" value="My 1, 2011"/>
<subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>
</value>
<value>
<subparam suboid="ClipName" value="Cripples, Bastards, and Broken Things"/>
<subparam suboid="Director" value="Brian Kirk"/>
<subparam suboid="OriginalAirDate" value="May 8, 2011 "/>
<subparam suboid="Author" value="Bryan Cogman"/>
</value>
<value>
<subparam suboid="ClipName" value="A Golden Crown"/>
<subparam suboid="Director" value="Daniel Minahan"/>
<subparam suboid="OriginalAirDate" value="May 22, 2011"/>
<subparam suboid="Author" value="David Benioff & D. B. Weiss"/>
</value>
</param>
<param access="1" constrainttype="INT_NULL" name="Selection" oid="Selection" precision="0" type="INT32" value="1" widget="label"/>
</params>
<ogscript handles="onkeypress" targetid="mytable">function doAfter() {
ogscript.debug("before: " + ogscript.getObject("current"));
ogscript.debug("20ms later " + params.getValue("Selection",0));
}
if (event.getKeyChar() == "10") {
ogscript.debug("Enter was pressed selection is " + params.getValue("Selection", 0));
ogscript.putObject("current", params.getValue("Selection",0));
ogscript.asyncExec(doAfter,20);
}
</ogscript>
</meta>
<param constrainttype="STRING_CHOICE" element="0" height="320" id="mytable" left="40" oid="params.clipList" precision="0" top="140" width="700">
<config key="w.selectionparam">Selection</config>
<constraint>ClipName</constraint>
<constraint>Director</constraint>
</param>
<button buttontype="push" height="60" left="760" name="Insert Row" top="320" width="120">
<task tasktype="ogscript">var newValue = {
ClipName: "",
Director: "",
OriginalAirDate: "",
Author: ""
}
var p = params.getParam('params.clipList', 0);
p.setValueAt(p.getElementCount(), newValue);</task>
</button>
<param expand="true" height="40" left="760" oid="Selection" style="bdr:etched;bg#dark;font:bold;size:Big;o#000000;fg#FFFFFF;txt-align:center;" top="180" widget="spinner" width="80">
<task tasktype="ogscript">/*! block id=1014,1016,1015 !*/
ogscript.debug(("selection has changed to " + params.getValue('Selection', 0)));
/*!!
<block id="1014" type="ogscript_debug" x="531" y="10" w="243" MESSAGE="ID:1016" />
<block id="1016" type="math_add" x="283" y="10" VALUE="selection has changed to " VAL_1="ID:1015" w="218" VAL_1_1="" />
<block id="1015" type="param__top&amp;Selection (Selection)[0]" x="10" y="10" w="243" SET="" />
!!*/
/*!!<checksum>77b645c16febcd859ce0239521416234</checksum>!!*/</task>
</param>
<button buttontype="push" height="60" left="760" name="Delete Selected" top="380" width="120">
<task tasktype="ogscript">var selection = params.getValue('Selection', 0);
if (selection < 0)
{
return;
}
var newValue = new Array();
var clipList = params.getParam('params.clipList', 0);
for (var i = 0; i < clipList.getElementCount(); i++)
{
if (i != selection)
{
newValue.push(clipList.getValueAt(i));
}
}
params.setAllValues('params.clipList', newValue);</task>
</button>
<label height="80" left="40" name="Structured Parameter Table" style="txt-align:west;size:Bigger;" top="0" width="700"/>
<label height="20" left="760" name="Selection:" style="txt-align:west" top="160" width="140"/>
<param constrainttype="STRING_CHOICE" element="0" height="120" left="40" oid="params.clipList" precision="0" top="520" width="700">
<config key="w.columns">Director, Author</config>
<constraint>ClipName</constraint>
<constraint>Director</constraint>
</param>
<label height="20" left="40" name="w.columns = Director, Author " style="txt-align:west;" top="500" width="500"/>
<label height="20" left="40" name="w.selectionparam = Selection (oid)" style="txt-align:west;" top="120" width="320"/>
<label height="40" left="40" name="See the Tables.grid example file to see all the config options that apply to tables. A table pointed to a structured parameter also has the w.columns config option." style="txt-align:west;" top="80" width="960"/>
</abs>
#DashBoard