Skip to Content
0
Sep 22, 2005 at 11:43 AM

Selection of radio buttons

66 Views

Hi

I have 3 radio buttons on my form But I can't select the correct one by code, If I do it by hand it works

I tried the click-method and I tried setting selected to true

My xml part looks like this



					<userdatasources> -
						<action type="add">
							<datasource size="2" type="1" uid="number"/>
							<datasource size="10" type="8" uid="text"/>
						</action> 
					</userdatasources>

						<item AffectsFormMode="1" backcolor="-1" description=""
							disp_desc="0" enabled="1" font_size="0" forecolor="-1"
							from_pane="0" height="14" left="23" linkto=""
							right_just="0" supp_zeros="0" tab_order="0"
							text_style="0" to_pane="0" top="22" type="122"
							uid="opt_single" visible="1" width="217">
							<AutoManagedAttribute/>
							<specific AffectsFormMode="1"
								caption="Single Dispense Order" val_off="0"
								val_on="1">
								<databind alias="number" databound="1" table=""/>
							</specific>
						</item>
						<item AffectsFormMode="1" backcolor="-1" description=""
							disp_desc="0" enabled="1" font_size="0" forecolor="-1"
							from_pane="0" height="14" left="23" linkto="opt_single"
							right_just="0" supp_zeros="0" tab_order="0"
							text_style="0" to_pane="0" top="44" type="122"
							uid="opt_col" visible="1" width="200">
							<AutoManagedAttribute/>
							<specific AffectsFormMode="1"
								caption="Collective Dispense Order" val_off="0"
								val_on="1">
								<databind alias="number" databound="1" table=""/>
							</specific>
						</item>
						<item AffectsFormMode="1" backcolor="-1" description=""
							disp_desc="0" enabled="1" font_size="0" forecolor="-1"
							from_pane="0" height="14" left="23" linkto="opt_sincol"
							right_just="0" supp_zeros="0" tab_order="0"
							text_style="0" to_pane="0" top="66" type="122"
							uid="opt_sincol" visible="1" width="250">
							<AutoManagedAttribute/>
							<specific AffectsFormMode="1"
								caption="Single Dispense Order of collective run"
								val_off="0" val_on="1">
								<databind alias="number" databound="1" table=""/>
							</specific>
						</item>

Loading my form:


            Dim newFormUID As String = LoadFromXML(myApp.oSAUIAddon.SBOApplication1, "DispenseOrders.srf", "dispord")
            Dim Form As SAPbouiCOM.IForm = myApp.oSAUIAddon.SBOApplication1.Forms.Item(newFormUID)
            Dim oRadio As SAPbouiCOM.IOptionBtn = Form.Items.Item("opt_single").Specific
            oRadio.Selected = True

            oRadio = Form.Items.Item("opt_col").Specific
            oRadio.GroupWith("opt_single")

            oRadio = Form.Items.Item("opt_sincol").Specific
            oRadio.GroupWith("opt_col")
            Form.Items.Item("opt_sincol").Enabled = False

The after_itempressed for the radiobuttons

        Dim item As IItem = Form.Items.Item(evt.ItemUID)
        Select Case evt.ItemUID
            Case "opt_single"
                item.Specific.selected = True
                Form.Items.Item("itemcode").Enabled = True
                Form.Items.Item("descr").Enabled = True
                Form.Items.Item("quantity").Enabled = True
                Form.Items.Item("customer").Enabled = True
                Form.Items.Item("itemcode").Click(BoCellClickType.ct_Regular)
            Case "opt_col"
                item.Specific.selected = True
                Form.Items.Item("whs").Click(BoCellClickType.ct_Regular)
                Form.Items.Item("itemcode").Enabled = False
                Form.Items.Item("descr").Enabled = False
                Form.Items.Item("quantity").Enabled = False
                Form.Items.Item("customer").Enabled = False
        End Select

What could be wrong.

any help is appriciated

Ad