cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with data binding within new instance

former_member184588
Active Participant
0 Kudos

Hello community,

I am just getting started with AIF and everything looks great and works except one thing:

I have a table with different fields. One of this fields - a combobox - is bound. This works for my first line. When I am now creating dynamically a new line/instance the binding seems not to be active any more. I am just able to add items to the combobox but don't know how to bind the combobox to the same data from the first line that I bound in the development environment.

So my question is: When I create a new instance. Should the binding be active for this instance like it is for the first line of the record? If not, is it possible to bind the records via JavaScript to the combobox of the new instance or do I have to loop through all my records and add everytime a single item?

Could someone bring some light into my darkness?

Thanks,

Vanessa

Accepted Solutions (0)

Answers (2)

Answers (2)

OttoGold
Active Contributor
0 Kudos

Hello Vanessa,

what type of scenario are you working on? ABAP WD = online form? Maybe you can add some details to help us understand your problem.

Regards Otto

Former Member
0 Kudos

Hi Vaneesa..

sorry i m not working in JavaScript. so please try to understand the logic. i know it will help u alot.

Thanx

Best Regards.

Rizwan Khan

Public Sub AddDataSourceToForm()

'//****************************************************************

'// every item must be binded to a Data Source

'// prior of binding the data we must add Data sources to the form

'//****************************************************************

'// Add user data sources to the "International Phone" column in the matrix

oUserDataSource = oForm.DataSources.UserDataSources.Add("IntPhone", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20)

'// Add DB data sources for the DB bound columns in the matrix

oDBDataSource = oForm.DataSources.DBDataSources.Add("OCRD")

End Sub

Public Sub BindDataToForm()

'// getting the matrix column by the UID

oColumn = oColumns.Item("DSCardCode")

'oColumn.DataBind.SetBound(True, "", "DSCardCode")

oColumn.DataBind.SetBound(True, "OCRD", "CardCode")

oColumn = oColumns.Item("DSCardName")

oColumn.DataBind.SetBound(True, "OCRD", "CardName")

oColumn = oColumns.Item("DSPhone")

oColumn.DataBind.SetBound(True, "OCRD", "Phone1")

'//************************************************

'// to Data Bind an item with a user Data source

'// the table name value should be an empty string

'//************************************************

oColumn = oColumns.Item("DSPhoneInt")

oColumn.DataBind.SetBound(True, "", "IntPhone")

End Sub

Public Sub GetDataFromDataSource()

'// Ready Matrix to populate data

oMatrix.Clear()

oMatrix.AutoResizeColumns()

'// Querying the DB Data source

oDBDataSource.Query()

'// setting the user data source data

oUserDataSource.Value = "Phone with prefix"

oMatrix.LoadFromDataSource()

End Sub

OttoGold
Active Contributor
0 Kudos

Hello,

are you sure about what you have posted? From my point of view you´re working with OCRD table (in SAP Business One) and the language is visual Basic. Maybe you should clarify this a little, maybe remove your post if that is what I think it is.

Regards Otto