After looking the Plex generated code in C# and the related definitions in Plex provided classes, I finally found out how to do the Plex Panel combo box dynamic loading in C#,
so here follows the related code I created as a source code API:
// Comment ...
// API Call Source code: Test Functions.TestCSharp.CS_ComboBoxAppendValues
{ ///////////////////////////////////////////////////////////////////////////////
// By Date Purpose
// NMDS 2019-12-05 Created : CS_ComboBoxAppendValues
// e.g. <PanelRegionName> = <Function Impl Name> + "Panel" + "_" + <Region Name>
// <PanelRegionName> = "TestCSh" + "Panel" + "_" + "Panel"
// <PanelRegionName> = "TestCShPanel_Panel"
///////////////////////////////////////////////////////////////////////////////
String sPanelRegionName, /*...PARAMETER:INPUT...*/
sControlName, /*...PARAMETER:INPUT...*/
sDatas; /*...PARAMETER:INPUT...*/
Char[] cInListDelimiter = new char[]{';'}, /*...PARAMETER:INPUT...*/
cListEndDelimiter = new char[]{'~'}; /*...PARAMETER:INPUT...*/
ObWPF.ObWPFCtrl.ObComboData pnlComboData;
String[] arDatas;
int arDatasLength;
sPanelRegionName = (&(1:).Value != null) ? (&(1:).Value).Trim() : "";
sControlName = (&(2:).Value != null) ? (&(2:).Value).Trim() : "";
sDatas = (&(3:).Value != null) ? (&(3:).Value).Trim() : "";
cInListDelimiter = (&(4:).Value != null) ? (&(4:).Value).ToCharArray(0,1) : cInListDelimiter;
cListEndDelimiter = (&(5:).Value != null) ? (&(5:).Value).ToCharArray(0,1) : cListEndDelimiter;
if (sPanelRegionName != "" && sControlName != "")
{ pnlComboData = (ObWPF.ObWPFCtrl.ObComboData)panel.GetControlByName(sControlName);
bool result = false;
//...DEBUG_CODE: MessageBox.Show("sPanelRegionName:["+sPanelRegionName+"]"); // e.g. "TestCShPanel_Panel"
result |= pnlComboData.exchangeData(Accessmode.CLEAR,
v.getVariable(sPanelRegionName).getAsObCharFldField(sControlName));
sDatas = sDatas.Replace(new String(cListEndDelimiter), new String(cInListDelimiter));
arDatas = sDatas.Split(cInListDelimiter);
arDatasLength = arDatas.Length;
for(int i =0; i < arDatasLength; i++)
{ //...insert each value:
v.getVariable(sPanelRegionName).getAsObCharFldField(sControlName).Value = arDatas[i];
result |= pnlComboData.exchangeData(Accessmode.INSERT,
v.getVariable(sPanelRegionName).getAsObCharFldField(sControlName));
}/*for(int i =0; i < arDatas.Length; i++) End*/
result |= pnlComboData.exchangeData(Accessmode.REFRESH,
v.getVariable(sPanelRegionName).getAsObCharFldField(sControlName));
}
}
------------------------------
Senior Software Engineer
BASIS SA
------------------------------
Original Message:
Sent: 11-22-2019 08:10 AM
From: NICOLAS MAVROEIDIS
Subject: ObPanelAPI::AddItemToListControl(FldCtrlNme,ItemVal); Analogous Needed for .Net Plex Generator
Hello All,
At CA Plex WinC (C++) Generator we had been given the following:
ObPanelAPI::AddItemToListControl(Field_Control_Name, Item_Value);
which enabled us to use it in our templates so as to dynamically load
some of the combo boxes in our panel functions.
Is there an analogous API for C# .Net Plex Generator ?
We do really need such a capability.
We have an application with near 1000 WinC panel functions and most of them
are is-a from our template functions utilizing this dynamic combo box loading.
So if we are to 'upgrade it to C# generator' we will surely need that.
Kind Regards,
Nicolas Mavroeidis
------------------------------
Senior Software Engineer
BASIS SA
------------------------------