cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with CFL Tab key does not work properly

Former Member
0 Kudos
199

Hi everyone,

many threads concerning correct handling of CFL, but I couldn't find a solution for my problem.

1.) I select an employee (object ID 171) ... this works fine, though the event for this CFL is triggered twice. But at least the next EditText can be reached with Tab key.

Here is a sample of my CFL event handling:

if (pVal.ItemUID == "tbxEmpNo" && pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST && pVal.BeforeAction == false)
{
       SAPbouiCOM.IChooseFromListEvent oCFLEvent = (SAPbouiCOM.IChooseFromListEvent)pVal;
       if (oCFLEvent.BeforeAction == false && oCFLEvent.ChooseFromListUID == "CFLEMP")
       {
       try
       {
              oForm = oSBOapp.Forms.GetForm("MyForm", 1);
              oDataTable = oCFLEvent.SelectedObjects;
              oForm.DataSources.UserDataSources.Item("cflEMP").ValueEx = Convert.ToString(oDataTable.GetValue("ExtEmpNo", 0));
              //oItem = oForm.Items.Item("tbxPwd");
              //oItem.Click(SAPbouiCOM.BoCellClickType.ct_Regular);
      }
      catch { }
}

2.) After an employee is selected, two grids are filled and some other EditTexts with CFL can be filled then. The eventhandling for those is almost similar to my example above. The problem is, that after choosing a value from CFL either by directly entering the value or by choosing it from the list, pressing the Tab key has no impact (except triggering the event again without opening the CFL). When I click into another field, the tab key works normal again.

No error occurs (catch block is never executed..)

As you can see in the last two lines of the try block, I have used a workaround by simulating a click on the next field. But I think there has to be a better solution?

Thanks

Sebastian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

*You Can Try This Code To Add CFL To Edit Text Box*

If pVal.FormUID = "CFL" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.ItemUID = "4" Then

If pVal.BeforeAction = False Then

Dim oForm As SAPbouiCOM.Form

Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent

oCFLEvento = pVal

Dim sCFL_ID As String

sCFL_ID = oCFLEvento.ChooseFromListUID

oForm = SBO_Application.Forms.Item(FormUID)

Dim oCFL As SAPbouiCOM.ChooseFromList

oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

If oCFLEvento.BeforeAction = False Then

Dim oDataTable As SAPbouiCOM.DataTable

oDataTable = oCFLEvento.SelectedObjects

Dim val As String

Try

val = oDataTable.GetValue(0, 0)

Catch ex As Exception

MessageBox.Show(ex.ToString)

End Try

If (pVal.ItemUID = "4") Then

oForm.DataSources.UserDataSources.Item("EditDS").ValueEx = val

End If

End If

End If

End If

Former Member
0 Kudos

Hi,

thanks for your reply.

My problem is that, depending on which sequence I open the CFLs, it sometimes works and sometimes not. As mentioned above the definitions and eventhandling is for each CFL almost the same, which makes me so perlexed.

Sample 1:

1st CFL = Employees. Works. 2nd CFL = BusinessPartners. Works. 3rd CFL = UDO1. Works.

Sample 2:

1st CFL = Employees. Works. 2nd CFL = UDO1. Does not work!

I have 6 CFLs (3 UDOs and 3 SAP Standards) and therefore many combinations of working and not working sequences. It also makes a difference, if I load data into a grid on the form, I don't know why. For example in Sample 1 the 2nd CFL doesn't work anymore, when I have filled the grid. I thought that switching between UDO and SAP Standard causes a problem, but not in every sequence.

I suppose that in the depth of events / eventhandling some references get lost or something, but even no error occurs (catch block is not reached). I guess nobody can help me with this problem. I'll try to find out...

Thanks

Sebastian

Former Member
0 Kudos

Hello Sebastian,

In SBO many events are triggerd twice, this is called a bubble-event.

In the before you must check if the action (the event triggered) could process.

In the after you can set other fields or create functionality, depending on the result of the prior action.

I think you have a problem and some events are not closing correctly.

I suggest that you take a look at B1DE for the B1 logger. This is an application which is catching all the events in SBO. It you compare this eventes with yours, you will maybe discover the error.

HTH Regards Teun

Former Member
0 Kudos

Hi Teun,

thanks for your suggestions. I have tried to find out the problem with Eventlogger, but I couldn't find a logic when the eventhandling gets broken. Depending on which sequence the CFLs are triggered, they work sometimes and sometimes not. I have now developed my own custom CFLs and handle the Tab-Key event by myself.

Regards

Sebastian

Answers (0)