Showing results for 
Search instead for 
Did you mean: 

Lost the value of an edit text

Former Member
0 Kudos

Hi all,

I have 2 EditText bind to a user table. When I am on the form, I entry a value to the first and when I go on the second, the value of the first is lost. Where is the problem?

A part of my code

'When I create the form


gobj_Item = cobj_Form.Items.Add("EPG_eDName", SAPbouiCOM.BoFormItemTypes.it_EDIT)

gobj_EditText = gobj_Item.Specific

gobj_EditText.DataBind.SetBound(True, "@EPG_EMPLOYER", "U_EPG_DutchName")

gobj_Item = cobj_Form.Items.Add("EPG_eFName", SAPbouiCOM.BoFormItemTypes.it_EDIT)

gobj_EditText = gobj_Item.Specific

gobj_EditText.DataBind.SetBound(True, "@EPG_EMPLOYER", "U_EPG_FrenchName")

'// On the menu event, after create the form

Public gobj_DBDS_Employer As SAPbouiCOM.DBDataSource

gobj_DBDS_Employer = cobj_Form.DataSources.DBDataSources.Item("@EPG_EMPLOYER")


If gobj_DBDS_Employer.Size = 0 Then

cobj_Form.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE


cobj_Form.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE

end if

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If u r not using matrix Then try to use

UserDataSources object

to bind edit text & then get value from UserDataSources object & save in DB etc

Former Member
0 Kudos

Thanks for your answer.

You means that I'd better avoid to use DBDatasource (I'm not using a matrix).

So another question, when you use Userdatasource, do I create only on "EditTextDS" for all the EditText or multiple like "EditTextDS1", "EditTextDS2".

I ask this question because before using DBDatasource , I have try with Userdatasource but when I entry an EditText, the other took the same value?

Former Member
0 Kudos

for each edit text Item on form u will use separate DBDatasource & will binde each Item with thses DBDatasource.

Then to set/Get value to/From any item u can set value in these DBDatasource object , It will be fast as compare to access Items of form directly.

(an extra note for u:However for if form is generate with UDO then case will be different., so if no UDO then neglect it)

Former Member
0 Kudos

I supposed you want to say UserDatasources instead of DBDatasource.

I have try with a Userdatasource per edit text and it run.

Thanks a lot.

Answers (0)