on 04-12-2016 5:52 PM
Hi experts,
I was wondering how to catch this event. I already set it to the filters and associate it with a form. In theory the event should raise in the FormLoadAfter but I can never catch it. Please share your experiences.
Regards
Hi Cristian,
This event is catched in ItemEvent.
To complement:
A form was drawn (ItemEvent).
The before event would raise after the FormLoadAfter event and before the form was drawn.
And after the form was drawn, which means all form items location/size is determined (for system form), the after form draw event would be raised.
Best regards,
Diego Lother
Message was edited by: DIEGO LOTHER
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diego,
Yes, I also thought that wil be the case, but it never gets raised.
I set the filters like this
EFilter = EFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DRAW)
EFilter.AddEx("MYUDO")
oApp.SetFilter(EFilters)
the catch the itemevent for that UDO and I make a Select Case for the eventtype.
It raises events like chosefromlist, validate, lostfocus etc etc. But the Draw event never comes...
or is is a eventy only native forms have?
Hi Cristian,
I have tested without use filters and even so, the event was not fire for UDO Form, but works fine for system form. If the event only works for native forms is not described in "SDK help" and I do not have assurance about this.
But I saw that have et_UDO_FORM_OPEN in UDOEvent, this event is fired before the Form be showed to the user, maybe can help you.
Hope it helps.
Best regards,
Diego Lother
The thing is that I have already the validvalues in the DB, but I need to hide some or show depending on the user. So the Default UDO combobox doesnt have any valid values, I have to add them depending on some factors.
So what i need is to catch some event after the UDO is completly loaded so i can use the combobox in order to add the validvalues. This needs to be done in the back so the user has the validvalues only for him.
Any ideas?
Cristian,
If you don't find any other solution, I think that this workaround helps you:
//A generic field to maintain the last event.
private static SAPbouiCOM.BoEventTypes pLastEvent = SAPbouiCOM.BoEventTypes.et_ALL_EVENTS;
static void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
{
BubbleEvent = true;
//After your form fire the visible event, the next event of the form is focus event with et_GOT_FOCUS.
//Add other params in your condition if is necessary.
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_GOT_FOCUS && !pVal.BeforeAction && pLastEvent == SAPbouiCOM.BoEventTypes.et_FORM_VISIBLE)
{
SAPbouiCOM.Form oForm = SBO_Application.Forms.GetForm(pVal.FormTypeEx, pVal.FormTypeCount);
SAPbouiCOM.ComboBox cb = (SAPbouiCOM.ComboBox)oForm.Items.Item("id your control").Specific;
cb.ValidValues.Add("1", "Test");
}
pLastEvent = pVal.EventType;
}
Hope it helps.
Best regards,
Diego Lother
Thanks Edy,
I am doing it right now, but since the combo has several validvalues (around 79) I notice some performance issues. The user can select a combo more than once and the function must execute itself again. Thats why I was wondering if it was possible to do it when the UDO form opens and forget about it.
Thanks anyway. Hope this event could be triggered in the future.
Best regards
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
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.