on 07-12-2012 8:35 AM
HI..
See the image..
This is my small addon just like incomming payement..
what i faced problem is ..
right side radio buttons are there cus,ven, ohter
if i select one among three based on that cardtype will be displyed
i had problem as
*************************
First time 3 radio buttons are empty
select customer radio button - wroking fine only card type 'c' will be display
second time
all ready customer radio button was selected ...
if i select radio button vendor first one will be checked false (group with fun i used)
if i press cfl empty data is comming..
once i closed the app and again sleect vendor it is working it is not giving the problem
with customer problem is repeating
only first time is working
second time is not working until i close the app
how can i refresh ...
Hi Seenu,
You have not set the GroupWith() property of the radio buttons. If you do so, only one radio button will be selected in one time. I am sharing a code with you just use it accordingly;
SAPbouiCOM.Item oItem;
SAPbouiCOM.OptionBtn btn1;
SAPbouiCOM.OptionBtn btn2;
SAPbouiCOM.OptionBtn btn3;
SAPbouiCOM.Form oForm = (SAPbouiCOM.Form)m_SBO_Form; ;
SAPbouiCOM.UserDataSource oUser;
oItem = (SAPbouiCOM.Item)oForm.Items.Add("Main", BoFormItemTypes.it_OPTION_BUTTON);
oItem.Left = 290;
oItem.Top = 10;
oItem.Height = 16;
oItem.Width = 220;
btn1 = (OptionBtn)oItem.Specific;
btn1.Caption = "Loan";
oUser = oForm.DataSources.UserDataSources.Add("MainItem", BoDataType.dt_SHORT_TEXT, 10);
btn1.DataBind.SetBound(true, "@PAYROLLINTIGRATION", "U_ACCNo");
//2ND button
oItem = (SAPbouiCOM.Item)oForm.Items.Add("Main1", BoFormItemTypes.it_OPTION_BUTTON);
oItem.Left = 290;
oItem.Top = 30;
oItem.Height = 16;
oItem.Width = 220;
btn2 = (OptionBtn)oItem.Specific;
btn2.Caption = "Claim";
oItem.Visible = true;
btn2 = (SAPbouiCOM.OptionBtn)oItem.Specific;
btn2.GroupWith("Main");
//3rd Button
oItem = (SAPbouiCOM.Item)oForm.Items.Add("Main2", BoFormItemTypes.it_OPTION_BUTTON);
oItem.Left = 290;
oItem.Top = 50;
oItem.Height = 16;
oItem.Width = 220;
btn3 = (OptionBtn)oItem.Specific;
btn3.Caption = "Others";
oItem.Visible = true;
btn3 = (SAPbouiCOM.OptionBtn)oItem.Specific;
btn3.GroupWith("Main");
Hope you understood. & hope it helps
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi.. Mr Ankit..
I had use group with in menu event as
oradio = oform.Items.Item("30").Specific
oradio.GroupWith("29")
oradio = oform.Items.Item("31").Specific
oradio.GroupWith("29")
*****************************
one more problem is comming
the probloem is
after select the card code (after select the cfl)
data (card code) is not comming into the eidt box
will u make any changes here is my code
*******************************************************
Public Class one
Private WithEvents sbo_app As SAPbouiCOM.Application
Private ocompany As SAPbobsCOM.Company
Private oform As SAPbouiCOM.Form
Private oradio As SAPbouiCOM.OptionBtn
Private ocon As SAPbouiCOM.Condition
Private ocons As SAPbouiCOM.Conditions
Private oedit As SAPbouiCOM.EditText
Private Sub setcon()
Try
Dim sboguiapi As SAPbouiCOM.SboGuiApi
Dim ss As String
sboguiapi = New SAPbouiCOM.SboGuiApi
ss = Environment.GetCommandLineArgs.GetValue(1)
sboguiapi.Connect(ss)
sbo_app = sboguiapi.GetApplication
ocompany = sbo_app.Company.GetDICompany
Catch ex As Exception
sbo_app.MessageBox(ex.Message)
End Try
End Sub
Private Sub addmenu()
Try
Dim omenuitem As SAPbouiCOM.MenuItem
Dim omenus As SAPbouiCOM.Menus
Dim ocrepack As SAPbouiCOM.MenuCreationParams
ocrepack = sbo_app.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
ocrepack.Type = SAPbouiCOM.BoMenuType.mt_POPUP
ocrepack.String = "User_Addon"
ocrepack.UniqueID = "one"
ocrepack.Image = "C:\Documents and Settings\madhukar\My Documents\Visual Studio 2005\Projects\sap b1 projects\Windo incompa\bin\Debug\3ee.png"
ocrepack.Position = 10
ocrepack.Enabled = True
omenuitem = sbo_app.Menus.Item("43520")
omenus = omenuitem.SubMenus
omenus.AddEx(ocrepack)
ocrepack.Type = SAPbouiCOM.BoMenuType.mt_STRING
ocrepack.UniqueID = "two"
ocrepack.String = "SubMenu"
ocrepack.Enabled = True
omenuitem = sbo_app.Menus.Item("one")
omenus = omenuitem.SubMenus
omenus.AddEx(ocrepack)
Catch ex As Exception
sbo_app.MessageBox(ex.Message)
End Try
End Sub
Public Sub msg()
sbo_app.MessageBox("Plz Wait Addon is Loading.....")
End Sub
Public Sub New()
MyBase.New()
setcon()
addmenu()
msg()
End Sub
Private Sub sbo_app_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles sbo_app.ItemEvent
Try
If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.BeforeAction = True) Then
BubbleEvent = True
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = sbo_app.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = True Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
Try
val = oDataTable.GetValue(0, 0)
Catch ex As Exception
End Try
If (pVal.ItemUID = "555") Then
If pVal.FormUID = "TT" Then
oForm = sbo_app.Forms.Item("TT")
oForm.Items.Item("555").Specific.value = val
End If
End If
oForm = sbo_app.Forms.Item("TT")
oradio = oForm.Items.Item("29").Specific
If (oradio.Selected = True) Then
ocons = oCFL.GetConditions()
ocon = ocons.Add()
ocon.Alias = "CardType"
ocon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
ocon.CondVal = "C"
'ocon.CondVal = "C"
Else
'oradio = oForm.Items.Item("30").Specific
'oradio.Selected = False
ocons = oCFL.GetConditions()
ocon = ocons.Add()
ocon.Alias = "CardType"
ocon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
ocon.CondVal = "S"
End If
oCFL.SetConditions(ocons)
End If
oCFL.SetConditions(ocons)
End If
Catch ex As Exception
sbo_app.MessageBox(ex.Message)
End Try
End Sub
Private Sub sbo_app_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles sbo_app.MenuEvent
Try
If (pVal.BeforeAction = False And pVal.MenuUID = "two") Then
sbo_app.MessageBox("You Are Clicking on Submneu")
'form loading
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
Dim sPath As String
sPath = IO.Directory.GetParent(Application.StartupPath).ToString
oXmlDoc.Load(sPath & "\" & "IP.srf")
sbo_app.LoadBatchActions(oXmlDoc.InnerXml)
oform = sbo_app.Forms.Item("TT")
oform.DataBrowser.BrowseBy = "555"
oform = sbo_app.Forms.Item("TT")
oedit = oform.Items.Item("555").Specific
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCFLs = oform.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = sbo_app.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "2"
oCFLCreationParams.UniqueID = "CFL1"
oCFL = oCFLs.Add(oCFLCreationParams)
oedit.ChooseFromListUID = "CFL1"
oradio = oform.Items.Item("30").Specific
oradio.GroupWith("29")
oradio = oform.Items.Item("31").Specific
oradio.GroupWith("29")
End If
Catch ex As Exception
sbo_app.MessageBox(ex.Message)
End Try
End Sub
End Class
Hi,
Use the GroupWith property in the form events. You write the form events as follows generally
public override void HANDLE_FORM_EVENTS(string FormUID, ref ItemEvent pVal, out bool BubbleEvent)
{
BubbleEvent = true;
}
After setting the bubbleevent to true, put your code just after that so that for every event on the form, the groupwith property will always set as you want.
Thanks
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.