on 06-09-2004 5:48 PM
Hi,
I created a checkbox on a user defined form and associated it with a user defined datsource to set its value based on a setting in the database during form load. Once the form loads, I am not able to change the state of the checkbox i.e. If its checked during form load, then I am not able to uncheck it by clicking oin the form and vice versa. I am using VB.NET and SDK 6.5. Any help is appeciated.
Thank You,
Gopal Viswanathan
Hi,
I've tested it with VB.NET & SDK 6.5.
In case the CheckBox is not clickable - that means that your datasource is not connected properly.
Use this syntax to bound your CheckBox to a userDataSource:
<i>'Adding the User DataSource</i>
oDS = oForm.DataSources.UserDataSources.Add("USDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
<i>'Binding the CheckBox</i>
oChkB.DataBind.SetBound(True, "", "USDS")
Regards,
Yaniv G.
SDK Consultant,
SAP Manage Israel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you for your quick response. I am doing exactly the same steps as you have mentioned. The code that I have wrotten below is being executed during the form load of my User defined form. I am able to even fill in the checkbox based on some true/false values from the database. But once these are filled I am not able to click the check box to change it. Should I be doing something else to persist the value of the datasource ?(the datasource is a Class level object)
'User defined Datasource
SAP_DS_ChkActive = frmRptDefs.DataSources.UserDataSources.Add("Chk", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
'Initialize check box
chkActive = frmRptDefs.Items.Item("chkActive").Specific
'Bind ChkBox
chkActive.DataBind.SetBound(True, "", "Chk")
Hi,
I have the same problem. The addon successfully worked with the SDK 6.2 version but when I became to use it with the SDK 6.5 the problems with checkboxes began.
I have made a simple test application that is not work properly. When the test form starts all checkboxes are disabled. If I click on the checkbox it becomes checked but I can not uncheck it back.
I use SBO 6.50.097 SP1.
This is the app code:
Private Sub Form_Load()
Me.Hide
'Connect to SBO Application
Dim clsApplication As SAPbouiCOM.Application
Dim clsGuiApi As SAPbouiCOM.SboGuiApi
Set clsGuiApi = New SAPbouiCOM.SboGuiApi
clsGuiApi.Connect Command()
Set clsApplication = clsGuiApi.GetApplication()
Set clsGuiApi = Nothing
'Load a test form from the xml-file
Dim strXML As String
Dim clsFSO As Scripting.FileSystemObject
Set clsFSO = New Scripting.FileSystemObject
Dim clsTextStream As Scripting.TextStream
Set clsTextStream = clsFSO.OpenTextFile(App.Path + "\" + "Form.xml")
strXML = clsTextStream.ReadAll
clsTextStream.Close
Set clsTextStream = Nothing
Set clsFSO = Nothing
clsApplication.LoadBatchActions strXML
'Fill a matrix cell's
Dim frm As SAPbouiCOM.Form
Set frm = clsApplication.Forms("Form")
frm.Freeze False
Dim i As Long
For i = 1 To 10
With frm.DataSources
.UserDataSources("Row").Value = i
.UserDataSources("String").Value = "Row " & i
.UserDataSources("Checkbox").Value = _
IIf(i Mod 2 = 1, "Y", "N")
Debug.Print IIf(i Mod 2 = 1, "Y", "N")
End With
frm.Items("Matrix").Specific.AddRow
Next i
frm.Freeze False
End Sub
This is the xml form definition:
<Application>
<forms>
<action type="add">
<form appformnumber="2000060006" color="0" default_button="" height="359" left="276" pane="1" title="Checkbox Test" top="88" uid="Form" visible="1" width="563">
<datasources>
<dbdatasources>
<action type="add"/>
</dbdatasources>
<userdatasources>
<action type="add">
<datasource size="4" type="0" uid="Row"/>
<datasource size="20" type="8" uid="String"/>
<datasource size="1" type="9" uid="Checkbox"/>
</action>
</userdatasources>
</datasources>
<menus/>
<items>
<action type="add">
<Item description="" disp_desc="0" enabled="1" from_pane="1" height="270" left="4" linkto="" right_just="0" tab_order="0" to_pane="1" top="24" type="127" uid="Matrix" visible="1" width="545">
<Specific SelectionMode="0" layout="0">
<columns>
<action type="add">
<column description="" disp_desc="0" editable="0" right_just="0" title="#" type="16" uid="Row" val_off="" val_on="" visible="1" width="27">
<databind alias="Row" databound="1" table=""/>
</column>
<column description="" disp_desc="0" editable="1" right_just="0" title="String" type="16" uid="String" val_off="" val_on="" visible="1" width="50">
<databind alias="String" databound="1" table=""/>
</column>
<column description="" disp_desc="0" editable="1" right_just="0" title="Checkbox" type="121" uid="Checkbox" val_off="" val_on="" visible="1" width="30">
<databind alias="Checkbox" databound="1" table=""/>
</column>
</action>
</columns>
</Specific>
</Item>
</action>
</items>
</form>
</action>
</forms>
</Application>
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.