Is it possible to have a dropdown inside a table cell.
And push the data from another table to the dropdown.
So one table would have the player names and in the other table these names can be selected as the home and away players.
<abs contexttype="opengear" dblinqport="2222" gridsize="20" keepalive="true">
<meta>
<lookup id="hosts">
<entry key="local.port">7788</entry>
<entry key="local.host">localhost</entry>
</lookup>
<params>
<param access="1" constrainttype="STRUCT" name="Match Info" oid="params.matchList" structtype="com.rossvideo.matchinfo" templateoid="templates.matchInfo" type="STRUCT_ARRAY" widget="table">
<value>
<subparam access="1" maxlength="0" name="MatchName" suboid="MatchName" type="STRING" value="Match One" widget="default"/>
<subparam access="1" maxlength="0" name="MatchNumber" suboid="MatchNumber" type="STRING" value="1" widget="default"/>
<subparam access="1" maxlength="0" name="MatchHomePlayer" suboid="MatchHomePlayer" type="STRING" value="Player One" widget="default"/>
<subparam access="1" maxlength="0" name="MatchAwayPlayer" suboid="MatchAwayPlayer" type="STRING" value="Player Two" widget="default"/>
</value>
<value>
<subparam suboid="MatchName" value="Match Two"/>
<subparam suboid="MatchNumber" value="2"/>
<subparam suboid="MatchHomePlayer" value="Player Three"/>
<subparam suboid="MatchAwayPlayer" value="Player Four"/>
</value>
<value>
<subparam suboid="MatchName" value="Match Three"/>
<subparam suboid="MatchNumber" value="3"/>
<subparam suboid="MatchHomePlayer" value="Player Five"/>
<subparam suboid="MatchAwayPlayer" value="Player Six"/>
</value>
</param>
<param access="1" constrainttype="STRUCT" name="Player Info" oid="templates.playerInfo" structtype="com.rossvideo.playinfo" type="STRUCT" widget="table">
<value>
<subparam access="1" maxlength="0" name="Name" suboid="PlayerName" type="STRING" value="Test" widget="default"/>
<subparam access="1" maxlength="0" name="Age" suboid="PlayerAge" type="STRING" value="Test" widget="default"/>
<subparam access="1" maxlength="0" name="Nationality" suboid="PlayerNationality" type="STRING" value="Test" widget="default"/>
</value>
</param>
<param access="1" constrainttype="STRUCT" name="Player Info" oid="templates.matchInfo" structtype="com.rossvideo.playinfo" type="STRUCT" widget="table">
<value>
<subparam access="1" maxlength="0" name="MatchName" suboid="MatchName" type="STRING" value="Test" widget="default"/>
<subparam access="1" maxlength="0" name="MatchAwayPlayer" suboid="MatchNumber" type="STRING" value="Test" widget="default"/>
</value>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Confirm Prompt" oid="Confirm_Prompt" precision="0" type="INT32" value="1" widget="button-prompt">
<config key="w.changeprompt">Submit changes?</config>
<constraint key="0">Submit Changes</constraint>
<constraint key="1">Submit Changes</constraint>
</param>
<param access="1" maxlength="0" name="rowstyles" oid="rowstyles" type="STRING" value="bg#000011;fg#ffffff" widget="default"/>
<param access="1" constrainttype="STRUCT" name="Player Info" oid="params.playerList" structtype="com.rossvideo.playerinfo" templateoid="templates.playerInfo" type="STRUCT_ARRAY" widget="table">
<value>
<subparam suboid="PlayerName" value="Player One"/>
<subparam suboid="PlayerAge" value="20"/>
<subparam suboid="PlayerNationality" value="USA"/>
</value>
<value>
<subparam suboid="PlayerName" value="Player Two"/>
<subparam suboid="PlayerAge" value="30"/>
<subparam suboid="PlayerNationality" value="CAN"/>
</value>
<value>
<subparam suboid="PlayerName" value="Player Three"/>
<subparam suboid="PlayerAge" value="40"/>
<subparam suboid="PlayerNationality" value="MEX"/>
</value>
<value>
<subparam suboid="PlayerName" value="Player Four"/>
<subparam suboid="PlayerAge" value="50"/>
<subparam suboid="PlayerNationality" value="AUS"/>
</value>
<value>
<subparam suboid="PlayerName" value=""/>
<subparam suboid="PlayerAge" value=""/>
<subparam suboid="PlayerNationality" value=""/>
</value>
</param>
<param access="1" constraint="0.0;100.0;0.0;100.0;1" constrainttype="INT_STEP_RANGE" name="Selection" oid="Selection" precision="0" type="INT32" value="3" widget="default"/>
<param access="1" constraint="0.0;100.0;0.0;100.0;1" constrainttype="INT_STEP_RANGE" name="SelectionMatch" oid="SelectionMatch" precision="0" type="INT32" value="0" widget="default"/>
<param access="1" constrainttype="STRING_CHOICE" name="Table" oid="params.table" precision="0" type="INT16" value="0" widget="table">
<constraint>params.array</constraint>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Confirm Prompt Delete" oid="Confirm_Prompt_Delete" precision="0" type="INT32" value="1" widget="button-prompt">
<config key="w.changeprompt">Are you sure you want to delete the selected row?</config>
<constraint key="0">Delete Row -</constraint>
<constraint key="1">Delete Row -</constraint>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Xpression Selector" oid="xpression.selector" precision="0" type="INT16_ARRAY" value="0;0;3;2" widget="default">
<constraint key="0">Player One</constraint>
<constraint key="1">Player Two</constraint>
<constraint key="2">Player Three</constraint>
<constraint key="3">Player Four</constraint>
<constraint key="4"/>
</param>
<param access="1" maxlength="0" name="Xpression Player Names" oid="xpression.playername" precision="0" type="STRING_ARRAY" widget="label">
<value>Player One</value>
<value>Player One</value>
<value>Player Three</value>
</param>
<param access="1" maxlength="0" name="Xpression Age" oid="xpression.age" precision="0" type="STRING_ARRAY" widget="label">
<value>20</value>
<value>20</value>
<value>40</value>
</param>
<param access="1" maxlength="0" name="Xpression Nationality" oid="xpression.nationality" precision="0" type="STRING_ARRAY" widget="label">
<value>USA</value>
<value>USA</value>
<value>MEX</value>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Confirm Prompt Delete Player" oid="Confirm_Prompt_Delete_Player" precision="0" type="INT32" value="1" widget="button-prompt">
<config key="w.changeprompt">Are you sure you want to delete the selected row?</config>
<constraint key="0">Delete Row -</constraint>
<constraint key="1">Delete Row -</constraint>
</param>
</params>
</meta>
<table height="640" left="840" top="20" width="900">
<tr>
<table fill="both" height="515" insets="2,2,2,2" left="10" style="bg#dark;bdr:round;" top="15" weightx="1.0" weighty="1.0" width="1235">
<tr>
<label colspan="2" fill="both" insets="2,2,2,2" name="Players" rowspan="1" style="txt-align:west;font:bold;size:Big;" weightx="1.0" weighty="0.0"/>
<button buttontype="push" colspan="1" fill="both" insets="2,2,2,2" name=" ▲ " rowspan="1" style="bg#lightdivider;size:16;font:bold;" weightx="0.0" weighty="0.0">
<task tasktype="ogscript">moveUp();</task>
<task tasktype="ogparamset">params.setValueRelative('Selection', 0, -1);</task>
</button>
<button buttontype="push" colspan="1" fill="both" insets="2,2,2,2" name=" ▼ " rowspan="1" style="bg#lightdivider;size:16;font:bold;" weightx="0.0" weighty="0.0">
<task tasktype="ogscript"/>
<task tasktype="ogparamset">params.setValueRelative('Selection', 0, 1);</task>
</button>
<button buttontype="push" colspan="1" fill="both" insets="2,2,2,2" name=" Add Row + " rowspan="1" style="bg#23B126;size:16;font:bold;" weightx="0.0" weighty="0.0">
<task tasktype="ogscript">var newValue = {
PlayerName: "",
PlayerAge: "",
PlayerNationality: ""
}
var p = params.getParam('params.playerList', 0);
p.setValueAt(p.getElementCount(), newValue);</task>
</button>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="Confirm_Prompt" rowspan="1" style="style:toggleButton;bg#001FC1;size:16;font:bold;txt-align:center;" weightx="0.0" weighty="0.0">
<task tasktype="ogscript"/>
<task tasktype="ogscript">//Set Dropdown Selection
var length = params.getElementCount('params.playerList');
length = length -1;
var nameArray = new Array();
for (i=0;i<=length;i++)
{
var name = params.getValue('params.playerList.' + i +'.PlayerName', 0);
nameArray[nameArray.length] = name;
}
params.replaceConstraint('xpression.selector', params.createIntChoiceConstraint(nameArray));</task>
<task tasktype="ogscript">//Set Dropdown Selection
var length = params.getElementCount('params.playerList');
length = length -1;
var nameArray = new Array();
for (i=0;i<=length;i++)
{
var name = params.getValue('params.playerList.' + i +'.PlayerName', 0);
nameArray[nameArray.length] = name;
}
params.replaceConstraint('params.col3', params.createIntChoiceConstraint(nameArray));</task>
</param>
</tr>
<tr>
<param colspan="8" constrainttype="STRING_CHOICE" element="0" evenstyle="f:bg#tablezebra;" fill="both" insets="2,2,2,2" oid="params.playerList" precision="0" rowspan="1" showlabel="false" style="t:bg#696969;" weightx="1.0" weighty="1.0">
<config key="w.selectionparam">Selection</config>
<config key="w.reorder">true</config>
<config key="w.padding">10,15</config>
<config key="w.colminwidth.0">250</config>
<constraint>PlayerName</constraint>
<constraint>PlayerAge</constraint>
<constraint>PlayerNationality</constraint>
</param>
</tr>
</table>
</tr>
</table>
<table height="640" left="40" top="20" width="780">
<tr>
<table colspan="1" fill="both" height="540" insets="2,2,2,10" left="1160" rowspan="1" style="bg#dark;bdr:round;" top="1360" weightx="1.0" weighty="1.0" width="1000">
<tr>
<label colspan="3" fill="both" insets="2,2,2,2" name="Matches" rowspan="1" style="txt-align:west;font:bold;size:Big;" weightx="1.0" weighty="0.0"/>
</tr>
<tr>
<param colspan="8" constrainttype="STRING_CHOICE" element="0" evenstyle="f:bg#tablezebra;" fill="both" insets="2,2,2,2" oid="params.matchList" precision="0" rowspan="1" showlabel="false" style="t:bg#696969;" weightx="1.0" weighty="1.0">
<config key="w.selectionparam">SelectionMatch</config>
<config key="w.reorder">true</config>
<config key="w.padding">10,15</config>
<config key="w.colminwidth.0">250</config>
<constraint>MatchName</constraint>
<constraint>MatchNumber</constraint>
<constraint>MatchHomePlayer</constraint>
<constraint>MatchAwayPlayer</constraint>
</param>
</tr>
</table>
</tr>
</table>
<table fill="both" height="460" insets="2,2,2,5," left="1960" style="bg#dark;bdr:round;" top="160" weightx="1.0" weighty="1.0" width="260">
<tr>
<label colspan="2" fill="both" height="40" insets="2,2,2,2" name="Home Player" rowspan="1" style="txt-align:center;font:bold;size:Big;" weightx="1.0"/>
</tr>
<tr>
<param colspan="2" element="0" expand="true" fill="both" insets="2,2,2,2" left="13" oid="xpression.selector" rowspan="1" runtasksonload="true" showlabel="false" style="bg#3F3F3F;" top="501" weightx="1.0" weighty="1.0">
<task tasktype="ogscript">var SelectedPlayer = params.getStrValue('xpression.selector', 0);
var length = params.getElementCount('params.playerList');
length = length -1;
for (var i=0;i<=length;i++)
{
var PlayerName = params.getValue('params.playerList.' + i +'.PlayerName', 0);
if (SelectedPlayer === PlayerName)
{
//Set Player Name
params.setValue('xpression.playername', 0, PlayerName);
ogscript.debug("SETTING PLAYER NAME: " + PlayerName);
//Set Age
var Age = params.getValue('params.playerList.' + i +'.PlayerAge', 0);
params.setValue('xpression.age', 0, Age);
ogscript.debug("SETTING AGE: " + Age);
//Set Nationality
var Nationality = params.getValue('params.playerList.' + i +'.PlayerNationality', 0);
params.setValue('xpression.nationality', 0, Nationality);
ogscript.debug("SETTING NATIONALITY: " + Nationality);
}
}</task>
</param>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="Name: " rowspan="1" style="txt-align:east" weightx="0.0" weighty="1.0"/>
<param colspan="1" element="0" expand="true" fill="both" insets="2,2,2,2" oid="xpression.playername" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="Age: " rowspan="1" style="txt-align:east;" weightx="0.0" weighty="1.0"/>
<param colspan="1" element="0" expand="true" fill="both" insets="2,2,2,2" oid="xpression.age" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="Nationality: " rowspan="1" style="txt-align:east;" weightx="0.0" weighty="1.0"/>
<param colspan="1" element="0" expand="true" fill="both" insets="2,2,2,2" oid="xpression.nationality" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
</tr>
</table>
<table fill="both" height="460" insets="2,5,2,2," left="2260" style="bg#dark;bdr:round;" top="160" weightx="1.0" weighty="1.0" width="260">
<tr>
<label colspan="2" fill="both" height="40" insets="2,2,2,2" name="Away Player" rowspan="1" style="txt-align:center;font:bold;size:Big;" weightx="1.0"/>
</tr>
<tr>
<param colspan="2" element="1" expand="true" fill="both" insets="2,2,2,2" left="13" oid="xpression.selector" rowspan="1" runtasksonload="true" showlabel="false" style="bg#3F3F3F;" top="501" weightx="1.0" weighty="1.0">
<task tasktype="ogscript">var SelectedPlayer = params.getStrValue('xpression.selector', 1);
var length = params.getElementCount('params.playerList');
length = length -1;
for (var i=0;i<=length;i++)
{
var PlayerName = params.getValue('params.playerList.' + i +'.PlayerName', 0);
if (SelectedPlayer === PlayerName)
{
//Set Player Name
params.setValue('xpression.playername', 1, PlayerName);
ogscript.debug("SETTING PLAYER NAME: " + PlayerName);
//Set Age
var Age = params.getValue('params.playerList.' + i +'.PlayerAge', 0);
params.setValue('xpression.age', 1, Age);
ogscript.debug("SETTING AGE: " + Age);
//Set Nationality
var Nationality = params.getValue('params.playerList.' + i +'.PlayerNationality', 0);
params.setValue('xpression.nationality', 1, Nationality);
ogscript.debug("SETTING NATIONALITY: " + Nationality);
}
}</task>
</param>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="Name: " rowspan="1" style="txt-align:east" weightx="0.0" weighty="1.0"/>
<param colspan="1" element="1" expand="true" fill="both" insets="2,2,2,2" oid="xpression.playername" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="Age: " rowspan="1" style="txt-align:east;" weightx="0.0" weighty="1.0"/>
<param colspan="1" element="1" expand="true" fill="both" insets="2,2,2,2" oid="xpression.age" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="Nationality: " rowspan="1" style="txt-align:east;" weightx="0.0" weighty="1.0"/>
<param colspan="1" element="1" expand="true" fill="both" insets="2,2,2,2" oid="xpression.nationality" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
</tr>
</table>
</abs>
------------------------------
Sam McIntosh
National Rugby League
Australia
------------------------------