I got the widget to work.
I'm making a dashboard for gymnastics where there's 2-6 events.
Each widget is connected to at least 2 different tables. One for the team, and one for the roster of players.
So, I have 6 event widgets.
When the operator selects which team is going to compete in each event, Im going to change the baseOID of the widget.
setBaseOID('team1'), etc...
At least that's the plan, but Im open to ideas.
------------------------------
David Levy
Lead Real Time Graphics Developer
ESPN
Charlotte United States
------------------------------
Original Message:
Sent: 10-30-2024 15:41
From: James Peltzer
Subject: Can a struct table inside a widget access params in the main dashboard?
Actually, after reading your problem again, I think you can probably get away with something a little easier than a widget. A widget is really handy if you want to reuse something in a lot of places (so if you had the table and a lot of other functionality you were looking to place in a number of locations or panels). If you have one UI and you just want to point it at different data sets, you might be better served by params.updateParamView. Below is an example using this to switch one table between 5 separate rosters. If you still want to go down the widget road, we can also look at that but I'd like to get a sense of the combination of things you're trying to do.
<abs contexttype="opengear" id="_top" keepalive="false" style=""> <meta> <params> <param access="1" constrainttype="STRUCT" name="roster.template" oid="roster.template" type="STRUCT" widget="table"> <value> <subparam access="1" maxlength="0" name="firstName" suboid="firstName" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="lastName" suboid="lastName" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="displayName" suboid="displayName" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="jersey" suboid="jersey" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="height" suboid="height" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="hometown" suboid="hometown" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="class" suboid="class" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="major" suboid="major" type="STRING" value="" widget="default"/> <subparam access="1" maxlength="0" name="active" suboid="active" type="STRING" value="" widget="default"/> </value> </param> <param access="1" constrainttype="STRUCT" name="roster1" oid="roster1" templateoid="roster.template" type="STRUCT_ARRAY" widget="table"> <value> <subparam suboid="firstName" value="John111"/> <subparam suboid="lastName" value="Smith"/> <subparam suboid="displayName" value="John Smith"/> <subparam suboid="jersey" value="1"/> <subparam suboid="height" value="6'2"/> <subparam suboid="hometown" value="Toronto, ON"/> <subparam suboid="class" value="Senior"/> <subparam suboid="major" value="Computer Science"/> <subparam suboid="active" value="Yes"/> </value> <value> <subparam suboid="firstName" value="Carl"/> <subparam suboid="lastName" value="White"/> <subparam suboid="displayName" value="Carl White"/> <subparam suboid="jersey" value="2"/> <subparam suboid="height" value="5'10"/> <subparam suboid="hometown" value="Ottawa, ON"/> <subparam suboid="class" value="Junior"/> <subparam suboid="major" value="Biology"/> <subparam suboid="active" value="Yes"/> </value> </param> <param access="1" constrainttype="STRUCT" name="roster2" oid="roster2" templateoid="roster.template" type="STRUCT_ARRAY" widget="table"> <value> <subparam suboid="firstName" value="John"/> <subparam suboid="lastName" value="Smith222"/> <subparam suboid="displayName" value="John Smith"/> <subparam suboid="jersey" value="1"/> <subparam suboid="height" value="6'2"/> <subparam suboid="hometown" value="Toronto, ON"/> <subparam suboid="class" value="Senior"/> <subparam suboid="major" value="Computer Science"/> <subparam suboid="active" value="Yes"/> </value> <value> <subparam suboid="firstName" value="Carl"/> <subparam suboid="lastName" value="White"/> <subparam suboid="displayName" value="Carl White"/> <subparam suboid="jersey" value="2"/> <subparam suboid="height" value="5'10"/> <subparam suboid="hometown" value="Ottawa, ON"/> <subparam suboid="class" value="Junior"/> <subparam suboid="major" value="Biology"/> <subparam suboid="active" value="Yes"/> </value> </param> <param access="1" constrainttype="STRUCT" name="roster3" oid="roster3" templateoid="roster.template" type="STRUCT_ARRAY" widget="table"> <value> <subparam suboid="firstName" value="John"/> <subparam suboid="lastName" value="Smith"/> <subparam suboid="displayName" value="John Smith333"/> <subparam suboid="jersey" value="1"/> <subparam suboid="height" value="6'2"/> <subparam suboid="hometown" value="Toronto, ON"/> <subparam suboid="class" value="Senior"/> <subparam suboid="major" value="Computer Science"/> <subparam suboid="active" value="Yes"/> </value> <value> <subparam suboid="firstName" value="Carl"/> <subparam suboid="lastName" value="White"/> <subparam suboid="displayName" value="Carl White"/> <subparam suboid="jersey" value="2"/> <subparam suboid="height" value="5'10"/> <subparam suboid="hometown" value="Ottawa, ON"/> <subparam suboid="class" value="Junior"/> <subparam suboid="major" value="Biology"/> <subparam suboid="active" value="Yes"/> </value> </param> <param access="1" constrainttype="STRUCT" name="roster4" oid="roster4" templateoid="roster.template" type="STRUCT_ARRAY" widget="table"> <value> <subparam suboid="firstName" value="John"/> <subparam suboid="lastName" value="Smith"/> <subparam suboid="displayName" value="John Smith"/> <subparam suboid="jersey" value="1444"/> <subparam suboid="height" value="6'2"/> <subparam suboid="hometown" value="Toronto, ON"/> <subparam suboid="class" value="Senior"/> <subparam suboid="major" value="Computer Science"/> <subparam suboid="active" value="Yes"/> </value> <value> <subparam suboid="firstName" value="Carl"/> <subparam suboid="lastName" value="White"/> <subparam suboid="displayName" value="Carl White"/> <subparam suboid="jersey" value="2"/> <subparam suboid="height" value="5'10"/> <subparam suboid="hometown" value="Ottawa, ON"/> <subparam suboid="class" value="Junior"/> <subparam suboid="major" value="Biology"/> <subparam suboid="active" value="Yes"/> </value> </param> <param access="1" constrainttype="STRUCT" name="roster5" oid="roster5" templateoid="roster.template" type="STRUCT_ARRAY" widget="table"> <value> <subparam suboid="firstName" value="John"/> <subparam suboid="lastName" value="Smith"/> <subparam suboid="displayName" value="John Smith"/> <subparam suboid="jersey" value="1"/> <subparam suboid="height" value="6'2555"/> <subparam suboid="hometown" value="Toronto, ON"/> <subparam suboid="class" value="Senior"/> <subparam suboid="major" value="Computer Science"/> <subparam suboid="active" value="Yes"/> </value> <value> <subparam suboid="firstName" value="Carl"/> <subparam suboid="lastName" value="White"/> <subparam suboid="displayName" value="Carl White"/> <subparam suboid="jersey" value="2"/> <subparam suboid="height" value="5'10"/> <subparam suboid="hometown" value="Ottawa, ON"/> <subparam suboid="class" value="Junior"/> <subparam suboid="major" value="Biology"/> <subparam suboid="active" value="Yes"/> </value> </param> <param access="1" constrainttype="INT_CHOICE" name="Roster Selector" oid="roster-selector" precision="0" type="INT32" value="1" widget="default"> <constraint key="1">Roster 1</constraint> <constraint key="2">Roster 2</constraint> <constraint key="3">Roster 3</constraint> <constraint key="4">Roster 4</constraint> <constraint key="5">Roster 5</constraint> </param> </params> </meta> <param expand="true" height="330" id="active-roster" left="107" oid="roster1" showlabel="false" top="130" width="707"/> <param expand="true" height="74" left="105" oid="roster-selector" runtasksonload="true" style="style:toggleButton;" top="480" widget="radio-toggle" width="707"> <task tasktype="ogscript">params.updateParamView('active-roster', 'roster' + this.getValue(), 0, null);</task> </param></abs>
------------------------------
James Peltzer
Ross Video
Original Message:
Sent: 10-29-2024 16:19
From: David Levy
Subject: Can a struct table inside a widget access params in the main dashboard?
Do you have a small example?
------------------------------
David Levy
Lead Real Time Graphics Developer
ESPN
Charlotte United States
Original Message:
Sent: 10-29-2024 14:43
From: James Peltzer
Subject: Can a struct table inside a widget access params in the main dashboard?
Hi David.
Yes, a widget can access any parameter in the panel. Typically we would use the baseoid attribute to change which parameter you want to feed as the 'main parameter' for the widget though people also use config parameters in to manage this (either one works fine).
What you will want to do is not define the 'struct table' inside of the widget and instead have the widget access the struct (either a top-level or a struct within a struct) from the outer panel.