on 09-23-2008 5:48 AM
Hi To All
I am Having 5 CheckBoxes in my screen..In that last checkbox is SelectAll Checkbox..If i select that check box, all the other 4 checkboxes should be checked..Its working fine..But, when i click the SelectAll checkbox after 4 to 5 Seconds only all the other checkboxes are selected..I had given form freeze...Wats the problem...Here is my source code..
Try
Conv_Form.Freeze(True)
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
If pVal.ItemUID = "chkSelectAll" And pVal.BeforeAction = False Then
If ChkSelectAll.Checked = "True" Then
Chk1.Checked = "True"
Chk2.Checked = "True"
Chk3.Checked = "True"
Chk4.Checked = "True"
Else
Chk1.Checked = "False"
Chk2.Checked = "False"
Chk3.Checked = "False"
Chk4.Checked = "False"
End If
End If
End Select
Conv_Form.Freeze(False)
Catch ex As Exception
Conv_Form.Freeze(False)
End Try
End Sub
Sridhar,
I think, that after Chk1.Checked = "True" is called other event for checking checkbox and this is doing something. Try to do it as
1. declare global variable calculate as boolean and set there default value True
dim calculate as boolean
calculate = True
2. change the code as
Try
Conv_Form.Freeze(True)
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
If pVal.ItemUID = "chkSelectAll" And pVal.BeforeAction = False Then
calculate = False
If ChkSelectAll.Checked = "True" Then
Chk1.Checked = "True"
Chk2.Checked = "True"
Chk3.Checked = "True"
Chk4.Checked = "True"
Else
Chk1.Checked = "False"
Chk2.Checked = "False"
Chk3.Checked = "False"
Chk4.Checked = "False"
End If
End If
End Select
caclulate = True
Conv_Form.Freeze(False)
Catch ex As Exception
Conv_Form.Freeze(False)
End Try
3. in itemevent add condition, that everyting in itemevent will be executed only when calculate = True
if caclulate = True then
.. your itemevent
end if
In the past I fought with simillar problem and with variable for testing in itemevent it was solved. Its just idea and maybe it will not works for you, but you may try it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is my source....Whether this is correct...?
My declaration
Dim calculate As Boolean = True
This is my Item Event..
Sub ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean)
Try
If calculate = True Then
Conv_Form.Freeze(True)
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
If pVal.ItemUID = "chkSelectAll" And pVal.BeforeAction = False Then
calculate = False
If ChkSelect.Checked = "True" Then
Chk1.Checked = "True"
Chk2.Checked = "True"
Chk3.Checked = "True"
Chk4.Checked = "True"
Else
Chk1.Checked = "False"
Chk2.Checked = "False"
Chk3.Checked = "False"
Chk4.Checked = "False"
End If
End If
End Select
calculate = True
Conv_Form.Freeze(False)
End If
Catch ex As Exception
Conv_Form.Freeze(False)
End Try
End Sub
Hi Petr, i had given like this....
Sub ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean)
Dim ChkSelectAll As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chkSelectAll").Specific
Dim Chk1 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk1").Specific
Dim Chk2 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk2").Specific
Dim Chk3 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk3").Specific
Dim Chk4 As SAPbouiCOM.CheckBox = Conv_Form.Items.Item("chk4").Specific
Try
Conv_Form.Freeze(True)
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
If pVal.ItemUID = "chkSelectAll" And pVal.BeforeAction = False And calculate = True Then
If ChkSelect.Checked = True Then
calculate = False
Chk1.Checked = True
Chk2.Checked = True
Chk3.Checked = True
.....
...
.
..
..
for me is there missing something like
conv_form = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
because you have the conv_form declared globaly, so I dont know, how you are doing it, when the user has opened more forms at a time.
Edited by: Petr Verner on Sep 24, 2008 7:02 AM
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.