on 09-10-2008 9:31 AM
Hi all,
I'd like to post this strange behaviour happening inside a user defined form for UDO processing.
i have the following code to clear each combobox in the UDO header:
cmbBPCode.get_ValidValues().Add("0", " ");
cmbBPCode.Select(" ", SAPbouiCOM.BoSearchKey.psk_ByDescription);
cmbBPCode.get_ValidValues().Remove(" ", SAPbouiCOM.BoSearchKey.psk_ByDescription);
cmbStatus.get_ValidValues().Add("0", " ");
cmbStatus.Select(" ", SAPbouiCOM.BoSearchKey.psk_ByDescription);
cmbStatus.get_ValidValues().Remove(" ", SAPbouiCOM.BoSearchKey.psk_ByDescription);
SAPbouiCOM.Form oForm = SBO_Application.get_Forms().get_ActiveForm();
SAPbouiCOM.Item oItem = oForm.get_Items().Item("txtCode");
oItem.set_DisplayDesc(true);
oItem = oForm.get_Items().Item("cmbStat");
oItem.set_DisplayDesc(true);
oForm.Refresh();
oForm.Update();
I need to do that beacuse after adding data into UDO tables, the combobox still holds the previous value.
In other words i got all the form fields cleared except for the combobox in the UDO header.
The above code solved the problem but shows the 0 value rather than the blank description in the combobox!
Is it the only way to do that?
Can anyone help me?
BR
Andrea
i solved using the following code:
oForm.Close();
DrawForm(); // load the form xml file
Andrea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrea,
i think i got the problem now
you use
oItem.set_DisplayDesc(true);
after you set the value.
do the following
when you load the UDO from a xml be sure that you set DisplayDesc already in screen painter
or set it when you load the xml in et_Form_load event.
that should do it ... i pray
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
David,
here is my code:
if (pVal.get_EventType() == SAPbouiCOM.BoEventTypes.et_FORM_LOAD && pVal.get_Before_Action() == false)
{
SAPbouiCOM.Form oForm = SBO_Application.get_Forms().Item(FormUID);
SAPbouiCOM.Item oItem = oForm.get_Items().Item("txtCode");
oItem.set_DisplayDesc(true);
oItem = oForm.get_Items().Item("cmbStat");
oItem.set_DisplayDesc(true);
}
but i got the following error:
"Invalid item [66000-3] for Item Unique Id: txtCode
it seems the form is not loaded yet when I catch the event!
Andrea
Hi Andrea,
your problems get stranger and stranger
the only thing i see is that you don't look for the right ItemUID in your If Statement.
If pval.FormUID == "myFormUID" AND ...
now your code works for every form that opens.
alternative:
please just try shortly to set the DisplayDesc (for one Test) in the XML with Screenpainter.
lg David
Hi,
After adding the data, Set the value for that combo as shown below for that dbdatasouce.
oDBs_Head.SetValue("ComboID", 0, "")
regards:
SANDY
Edited by: | Sandeep Saini | Roorkee | India on Sep 10, 2008 2:11 PM
Edited by: | Sandeep Saini | Roorkee | India on Sep 10, 2008 2:11 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.