hello
I have a table with an update button, but when I press it it returns an erroneous value, in some rows it is the correct value, but in other rows it returns the same value even when I press different rows.
Pressing different lines, the log shows me the same value
If I use input text as a trigger, it works, but using the button I don't have the correct value, are the values I'm using incorrect?
Thanks
Table:
<Param id="10039">
<Name>Update (Fuentes XM3)</Name>
<Type>write</Type>
<Information>
</Information>
<Interprete>
<RawType>numeric text</RawType>
<Type>double</Type>
<LengthType>next param</LengthType>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
</Display>
<Measurement>
<Type width="110">button</Type>
<Discreets>
<Discreet>
<Display>Update</Display>
<Value>1</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
Botton Trigger:
<Param id="10039">
<Name>Update (Fuentes XM3)</Name>
<Type>write</Type>
<Information>
</Information>
<Interprete>
<RawType>numeric text</RawType>
<Type>double</Type>
<LengthType>next param</LengthType>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
</Display>
<Measurement>
<Type width="110">button</Type>
<Discreets>
<Discreet>
<Display>Update</Display>
<Value>1</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
Qaction:
<QAction id="10039" name="updateData" encoding="csharp" row="true" triggers="10039">
<![CDATA[using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Skyline.DataMiner.Scripting;
/// <summary>
/// DataMiner QAction Class: update.
/// </summary>
public static class QAction
{
/// <summary>
/// The QAction entry point.
/// </summary>
/// <param name="protocol">Link with SLProtocol process.</param>
public static void Run(SLProtocol protocol)
{
try
{
protocol.Log("------------" + protocol.RowKey());
string url = "api/fuentes/" + Convert.ToString(protocol.RowKey());
protocol.SetParameter(Parameter.urlpost, url);
protocol.CheckTrigger(1013);
}
catch (Exception ex)
{
protocol.Log($"QA{protocol.QActionID}|{protocol.GetTriggerParameter()}|Run|Exception thrown:{Environment.NewLine}{ex}", LogType.Error, LogLevel.NoLogging);
}
}
}]]>
</QAction>
Hi Jose, im added as new asnwer for the xml
i foud the posible problem, the naming is using 2 parameters, this could be emplty for some case, is this is emply
<Param id="10000">
<Name>tableXM3</Name>
<Description>Fuentes Table</Description>
<Type>array</Type>
<ArrayOptions index="0" options=";naming=|10036,10037">
<ColumnOption idx="0" pid="10001" type="retrieved" options=""/>
<ColumnOption idx="1" pid="10002" type="retrieved" options=""/>
<ColumnOption idx="2" pid="10003" type="retrieved" options=""/>
<ColumnOption idx="3" pid="10004" type="retrieved" options=""/>
<ColumnOption idx="4" pid="10005" type="retrieved" options=""/>
<ColumnOption idx="5" pid="10006" type="retrieved" options=""/>
<ColumnOption idx="6" pid="10007" type="retrieved" options=""/>
<ColumnOption idx="7" pid="10008" type="retrieved" options=""/>
<ColumnOption idx="8" pid="10009" type="retrieved" options=""/>
<ColumnOption idx="9" pid="10010" type="retrieved" options=""/>
<ColumnOption idx="10" pid="10011" type="retrieved" options=""/>
<ColumnOption idx="11" pid="10012" type="retrieved" options=""/>
<ColumnOption idx="12" pid="10013" type="retrieved" options=""/>
<ColumnOption idx="13" pid="10014" type="retrieved" options=""/>
<ColumnOption idx="14" pid="10015" type="retrieved" options=""/>
<ColumnOption idx="15" pid="10016" type="retrieved" options=""/>
<ColumnOption idx="16" pid="10017" type="retrieved" options=""/>
<ColumnOption idx="17" pid="10018" type="retrieved" options=""/>
<ColumnOption idx="18" pid="10019" type="retrieved" options=""/>
<ColumnOption idx="19" pid="10020" type="retrieved" options=""/>
<ColumnOption idx="20" pid="10021" type="retrieved" options=""/>
<ColumnOption idx="21" pid="10022" type="retrieved" options=""/>
<ColumnOption idx="22" pid="10023" type="retrieved" options=""/>
<ColumnOption idx="23" pid="10024" type="retrieved" options=""/>
<ColumnOption idx="24" pid="10025" type="retrieved" options=""/>
<ColumnOption idx="25" pid="10026" type="retrieved" options=""/>
<ColumnOption idx="26" pid="10027" type="retrieved" options=""/>
<ColumnOption idx="27" pid="10028" type="retrieved" options=""/>
<ColumnOption idx="28" pid="10029" type="retrieved" options=""/>
<ColumnOption idx="29" pid="10030" type="retrieved" options=""/>
<ColumnOption idx="30" pid="10031" type="retrieved" options=""/>
<ColumnOption idx="31" pid="10032" type="retrieved" options=""/>
<ColumnOption idx="32" pid="10033" type="retrieved" options=""/>
<ColumnOption idx="33" pid="10034" type="retrieved" options=""/>
<ColumnOption idx="34" pid="10035" type="retrieved" options=""/>
<ColumnOption idx="35" pid="10036" type="retrieved" options=""/>
<ColumnOption idx="36" pid="10037" type="retrieved" options=""/>
<ColumnOption idx="37" pid="10038" type="retrieved" options=""/>
<ColumnOption idx="38" pid="10039" type="retrieved" options=""/>
<ColumnOption idx="39" pid="10040" type="retrieved" options=""/>
<ColumnOption idx="40" pid="10041" type="retrieved" options=""/>
</ArrayOptions>
<Information>
<Subtext>tableInformation</Subtext>
</Information>
<Display>
<RTDisplay>true</RTDisplay>
<Positions>
<Position>
<Page>General</Page>
<Column>0</Column>
<Row>3</Row>
</Position>
</Positions>
</Display>
<Measurement>
<Type options="tab=columns:10001|0-10035|34-10039|38-10041|40-10038|37-10040|39-10002|1-10036|35-10037|36-10003|2-10034|33-10004|3-10005|4-10006|5-10007|6-10008|7-10009|8-10010|9-10012|11-10013|12-10014|13-10015|14-10016|15-10017|16-10018|17-10019|18-10020|19-10021|20-10022|21-10023|22-10024|23-10025|24-10026|25-10027|26-10028|27-10029|28-10030|29-10031|30-10032|31-10033|32,width:63-100-100-158-0-139-117-137-136-77-50-55-121-112-145-125-103-86-67-83-98-99-130-108-112-110-188-180-73-122-129-139-127-203-143-73-73-73-78-100,sort:STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-INT-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING-STRING,lines:25,filter:true">table</Type>
</Measurement>
</Param>
Hi Juan,
I reviewed your code, and at first glance, everything looks correct.
Do you have any problems when you Build/Re-build your solution?
Are you sure this version is the one your element is running?
Any errors on the element logs?
Kind regards,
i found the problem, the naming was usging two parameters that could be emplty so i add other to correct the index, its posible work with a naming separaed of the index table?
Hi Juan,
Your DisplayKey syntax is indeed incorrect when using more than one column to build the key. You need to save the result in a separate column and use the type=”displaykey” attribute. It’s recommended to define this column at the end of the table.
You can see more info here:
https://docs.dataminer.services/develop/devguide/Connector/UIComponentsTableDisplayKeys.html#naming
Hi Jose
How do i save the value in the “displayKey column”, when i use the QactionRow to create the row and use protocol.FillArray(10000, rowsList, NotifyProtocol.SaveOption.Full) the table is empty becuase the displayKey column is part of the row
Hi Juan,
You just need an additional column and instead of type=”retrieved” you will need type=”displaykey”.
DataMiner will fill in that column automatically, so you don’t need to add it on your fillArray method.
Kind regards,
Hi Juan,
Could you show us your table xml? I think you made a typo on your message.
Thanks