on 10-12-2005 9:41 PM
Hi there,
I get a problem with DataBind Matrix, I like to show CFL
in one column in Matrix, the Matrix bind with a DBDataSource,when user press TAB Key in the cell that link with CFL, it show the CFL dialog, the problem is after user choose one row from CFL, I should fill the cell with the choose value, but the datasource do not content the new value, the CFL will show again, do I need add the new row to DB and Load data from datasource again, or have other better way to show CFL and fill the choose value as user input value?
Thanks in advance!
Lanjun Wang
Hi Lanjun,
Once you select a row from the CFL you will receive an event of type SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST.
You must catch this event, inside it you have the information about the content selected in the CFL by using:
eventCFL.SelectedObjects.GetValue(0, 0)
You only have to fill your DBDataSource with this value, it isn't done automatically.
Hope it helps
Trinidad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lanjun,
You must refresh the DBDataSource value and then call LoadFromDataSource to refresh the matrix.
Here you have a sample to place on the code receiving the event et_CHOOSE_FROM_LIST:
oForm.DataSources.DBDataSources.Item("@MY_TABLE").SetValue("Code", recordIndex, eventCFL.SelectedObjects.GetValue(0, 0))
oMatrix.LoadFromDataSource()
Hope it helps
Trinidad.
Message was edited by: Trinidad Martinez
Hi Harshad,
Try this......
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
If pVal.BeforeAction = False Then
Dim db1 As SAPbouiCOM.DBDataSource = frm.DataSources.DBDataSources.Item("@DetailTableName")
Dim mat As SAPbouiCOM.Matrix = frm.Items.Item("matMatrix").Specific
Dim cflevent As SAPbouiCOM.ChooseFromListEvent = pVal
Dim cfl As SAPbouiCOM.ChooseFromList
Dim a As String = cflevent.ChooseFromListUID
cfl = frm.ChooseFromLists.Item(a)
Dim dt As SAPbouiCOM.DataTable = cflevent.SelectedObjects
If Not (dt Is Nothing) Then
If cfl.UniqueID = "ItemCFL" Then
If pVal.Row = mat.VisualRowCount Then
db1.Offset = db1.Size - 1
db1.SetValue("U_ItemID", db1.Offset, "")
db1.SetValue("U_ItemDesc", db1.Offset, "")
mat.SetLineData(db1.Size)
mat.FlushToDataSource()
End If
db1.SetValue("U_ItemID", db1.Offset, dt.GetValue(0, 0))
db1.SetValue("U_ItemDesc", db1.Offset, dt.GetValue(1, 0))
mat.SetLineData(pVal.Row)
mat.FlushToDataSource()
End If
End If
End if
Thanks it worked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
8 | |
8 | |
5 | |
4 | |
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.