Dokumentation SwissAddonFramework / Probleme ComboBox
arewer
Hallo zusammen,
gibt es eigentlich eine Dokumentation des SwissAddonFramework oder Beispiele. Ich habe nämlich das Gefühl, ich nutze die Klassen falsch. Ich kann z. B. zu einer ComboBox, die ich mit dem Framework erstellt habe keine "ValidValues" hinzufügen. Über die normale SAP-API habe ich hiermit kein Problem.
Code mit Framework:
ComboBox CB = ComboBox.CreateNew("TestCB");
CB.Top = 230;
CB.Left = 30;
CB.Width = 150;
CB.FromPane = 0;
CB.ToPane = 0;
CB.ValidValues.Add("1", "Description 1");
Dieser Code wird mit einem Fehler quittiert:
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Code UI:
SAPbouiCOM.Form mForm;
SAPbouiCOM.Item mItem = null;
SAPbouiCOM.ComboBox mSAPComb = null;
mForm = mApp.Forms.ActiveForm;
mItem = mForm.Items.Add("CBSAP", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
mItem.Left = 157;
mItem.Width = 163;
mItem.Top = 24;
mItem.Height = 14;
mItem.DisplayDesc = false;
mSAPComb = ( ( SAPbouiCOM.ComboBox ) ( mItem.Specific ) );
mSAPComb.ValidValues.Add("1", "Combo Value 1");
mSAPComb.ValidValues.Add("2", "Combo Value 2");
mSAPComb.ValidValues.Add("3", "Combo Value 3");
Dieser Code arbeitet einwandfrei.
Leider finde ich zum Framework keinerlei Dokus, wie die Funktionen anzuwenden sind. Ich würde allerdings das Framework schon gerne nutzen, da vieles doch einfacher scheint.
Ich bin für jegliches Material, also Doku, Beispielcode etc., dass ich bzgl. des Frameworks bekommen kann dankbar.
Gruß
Andre
Paolo Manfrin
Hi,
adding value should be done after the loading of the combobox into the form:
<pre class="brush-clang syntax">// create form
Form form = Form.CreateNewForm("TEEST", "12345");
// create combobox
ComboBox cb = ComboBox.CreateNew("Cb1");
// add combobox to form
form.AddItem(cb);
// load form
form.Load();
// add values to combobox
cb.ValidValues.Add("1", "first");
cb.ValidValues.Add("2", "second");
cb.ValidValues.Add("3", "third");</pre>
You can check also the following forum entry:
http://forum.coresystems.ch/index.php?/topic/5395-bind-combobox-to-tabel-ocrg/?hl=combobox.createnew
hth,
paolo
arewer
OK, thanks for your answer, but is there any documentation about the framework available?
Please sign in to leave a comment.
Comments
0 comments