Search Results

Search found 265 results on 11 pages for 'radiobutton'.

Page 2/11 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Flex ; get the value of RadioButton inside a FormItem

    - by numediaweb
    Hi, I'm working on Flash Builder with latest flex SDK. I have a problem getting the value radioButton of the selceted radio button inside a form: <mx:Form id="form_new_contribution"> <mx:FormItem label="Contribution type" includeIn="project_contributions"> <mx:RadioButtonGroup id="myG" enabled="true" /> <mx:RadioButton id="subtitle" label="subtitle" groupName="{myG}" value="subtitle"/> <mx:RadioButton id="note" label="notes / chapters" groupName="{myG}" value="note"/> </mx:FormItem> </mx:Form> the function is: protected function button_add_new_clickHandler(event:MouseEvent):void{ Alert.show(myG.selectedValue.toString()); } I tried also: Alert.show(myG.selection.toString()); bothe codes show error: TypeError: Error #1009: Cannot access a property or method of a null object reference. and if It only works if I put : Alert.show(myG.toString()); it alerts : Object RadioButtonGroup thanx for any hints, and sorry for the long message :)

    Read the article

  • Retrieve GWT radiobutton value in server from the request

    - by Florian d'Erfurth
    Hi, I'm having a headache figuring how to retrieve the gwt Radio Buttons values in the server side. Here is my UiBinder form: <g:FormPanel ui:field="form"><g:RadioButton name="fruit">apple</g:RadioButton><g:RadioButton name="fruit">banana</g:RadioButton> ... So i though i would have to do this on the servlet: fruit = req.getParameter("fruit") But of course this doesn't work, parameter fruit doesn't exist :/ So how should i do?

    Read the article

  • How to get a asp:radiobutton text in javascript?

    - by bala3569
    How to get a asp:radiobutton text in javascript? I use this RbDriver1.Text = dt.Rows[0].ItemArray[5].ToString(); RbDriver2.Text = dt.Rows[0].ItemArray[6].ToString() ; and my javascript function is function getDriverwireless() { alert(document.getElementById("ctl00_ContentPlaceHolder1_RbDriver1")); alert(document.getElementById("ctl00_ContentPlaceHolder1_RbDriver1").innerHTML); } innerHTML doesnt seems to take the text of my radiobutton...any suggestion When i inspect throgh firebug i found this <input type="radio" onclick="getDriverwireless();" value="RbDriver1" name="ctl00$ContentPlaceHolder1$drivername" id="ctl00_ContentPlaceHolder1_RbDriver1"> <label for="ctl00_ContentPlaceHolder1_RbDriver1">kamal,9566454564</label> I want to get the value kamal,9566454564 in javascript...

    Read the article

  • WPF: How to bind RadioButtons to an enum?

    - by Sam
    I've got an enum like this: public enum MyLovelyEnum { FirstSelection, TheOtherSelection, YetAnotherOne }; I got a property in my DataContext: public MyLovelyEnum VeryLovelyEnum { get; set; } And I got three RadioButtons in my WPF client. <RadioButton Margin="3">First Selection</RadioButton> <RadioButton Margin="3">The Other Selection</RadioButton> <RadioButton Margin="3">Yet Another one</RadioButton> Now how do I bind the RadioButtons to the property for proper two-way-binding?

    Read the article

  • how to conditional display a control in asp wizard based on the radiobutton click in a particular st

    - by Pramod
    Hi, I've been stuck with this problem where there are 3 steps in an asp wizard control. The first step has a radiobutton (yes and no) and based on the radio button input chosen by the user, i would need to hide or show a label in the second wizardstep. Example: Step 1: Choose 1 among the two options: Yes No (radStep1) Step 2: if the radiobutton option in the previous step was yes.. then display a label(lblStep2) in this step.. Else hide the label. I've been handling this through the jquery as i want the functionality in the aspx page itself... The jquery code goes like this... $("#<%=radStep1.ClientID %> input").click(function() { if($("#<%= radStep1.ClientID %> input").index(this) == 0) { $("#<%=lblStep2.ClientID %>").show(); } else if($("#<%= radStep1.ClientID %> input").index(this) == 1) { $("#<%=lblStep2.ClientID %>").hide(); } However, in both the cases, the label is getting displayed.. Could you please help me out if there is anything that i'm missing? I'm guessing that the label is getting hidden at first and then getting shown again once i click on the next button... Thanks a ton in advance....

    Read the article

  • RadioButton checkedchanged event firing multiple times

    - by kash3
    Hi, I am trying to add multiple radiobutton columns to my gridview dynamically in the code and i want to implement some logic which involves database fetch in the checkedchanged event of radiobuttons but some how the checked changed event is being fired multiple times for each row. Following is the code: aspx: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" EnableViewState="true" BorderWidth="1px" CellPadding="4" Font-Names="Verdana"> <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" /> <Columns> <asp:TemplateField HeaderText="Select One"> <ItemTemplate> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Select Two"> <ItemTemplate> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:Label ID="lblval" runat="server" Text="!" ForeColor="Red" Visible="false"/> </ItemTemplate> </asp:TemplateField> </Columns> **code behind** void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.DataItem != null) { DataRowView dvRowview = (DataRowView)e.Row.DataItem; int currentRow = GridView1.Rows.Count; RadioButton rdoSelect1 = new RadioButton(); rdoSelect1.GroupName = "Select" + currentRow; rdoSelect1.ID = string.Concat("rdoSelect1", currentRow); rdoSelect1.AutoPostBack = true; rdoSelect1.CheckedChanged += new EventHandler(rdoSelect_CheckedChanged); e.Row.Cells[0].Controls.Add(rdoSelect1); RadioButton rdoSelect2 = new RadioButton(); rdoSelect2.GroupName = "Select" + currentRow; rdoSelect2.ID = string.Concat("rdoSelect2", currentRow); rdoSelect2.AutoPostBack = true; rdoSelect2.CheckedChanged += new EventHandler(rdoSelect_CheckedChanged); e.Row.Cells[1].Controls.Add(rdoSelect2); if (!IsPostBack) { e.Row.Cells[e.Row.Cells.Count - 1].Controls[1].Visible = false; if (e.Row.Cells[0] != null && Convert.ToBoolean(dvRowview["Select1"]) == true) rdoSelect1.Checked = true; else rdoSelect1.Checked = false; if (e.Row.Cells[0] != null && Convert.ToBoolean(dvRowview["Select2"]) == true) rdoSelect2.Checked = true; else rdoSelect2.Checked = false; } } } void rdoSelect_CheckedChanged(object sender, EventArgs e) { RadioButton rdoSelectedOption = (RadioButton)sender; GridViewRow selRow = rdoSelectedOption.NamingContainer as GridViewRow; if (rdoSelectedOption.Checked) selRow.Cells[selRow.Cells.Count - 1].Controls[1].Visible = true; else selRow.Cells[selRow.Cells.Count - 1].Controls[1].Visible = false; } i want the checkedchanged event to fire only once for a group name and row.

    Read the article

  • Custom RadioButton image not filling space

    - by Galip
    Hi guys, I have a custom radiobutton with a 9-patch image as background. I use a Selector to determine the background. I also have some text i want to put over the background of the image, but the text is aligning next to the button. This is the RadioGroup <LinearLayout android:id="@+id/segmented" android:layout_width="fill_parent" android:layout_height="50sp" android:gravity="center" android:layout_below="@+id/header"> <RadioGroup android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/group1" android:gravity="center"> <RadioButton android:checked="false" android:layout_width="90sp" android:id="@+id/rbVerzekeringen" android:text="Verzekeringen" android:textSize="10sp" android:button="@drawable/checkbox_theme" /> <RadioButton android:checked="false" android:layout_width="90sp" android:id="@+id/rbPersoonlijk" android:text="Persoonlijk" android:textSize="10sp" android:button="@drawable/checkbox_theme" /> <RadioButton android:checked="false" android:layout_width="90sp" android:id="@+id/rbNotities" android:text="Notities" android:textSize="10sp" android:button="@drawable/checkbox_theme" /> </RadioGroup> </LinearLayout> This is the Selector: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:state_window_focused="false" android:drawable="@drawable/bt_filter_active" /> <item android:state_checked="false" android:state_window_focused="false" android:drawable="@drawable/bt_filter" /> <item android:state_checked="true" android:state_pressed="true" android:drawable="@drawable/bt_filter_active" /> <item android:state_checked="false" android:state_pressed="true" android:drawable="@drawable/bt_filter" /> <item android:state_checked="true" android:state_focused="true" android:drawable="@drawable/bt_filter_active" /> <item android:state_checked="false" android:state_focused="true" android:drawable="@drawable/bt_filter" /> <item android:state_checked="false" android:drawable="@drawable/bt_filter" /> <item android:state_checked="true" android:drawable="@drawable/bt_filter_active" /> </selector> And this is what it lookes like: As you can figure out I want 3 large buttons with the text over it. How can I do this? EDIT: I set the selector at background in stead of button and set the button to null. The code looks like this now: <LinearLayout android:id="@+id/segmented" android:layout_width="fill_parent" android:layout_height="50sp" android:gravity="center" android:layout_below="@+id/header"> <RadioGroup android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/group1" android:gravity="center"> <RadioButton android:checked="false" android:layout_width="100sp" android:layout_height="40sp" android:id="@+id/rbVerzekeringen" android:text="Verzekeringen" android:textSize="13sp" android:orientation="vertical" android:background="@drawable/checkbox_theme" android:button="@null" android:gravity="center"/> <RadioButton android:checked="false" android:layout_width="100sp" android:layout_height="35sp" android:id="@+id/rbPersoonlijk" android:text="Persoonlijk" android:textSize="35sp" android:background="@drawable/checkbox_theme" android:button="@null" android:gravity="center"/> <RadioButton android:checked="false" android:layout_width="100sp" android:layout_height="30sp" android:id="@+id/rbNotities" android:text="Notities" android:textSize="13sp" android:background="@drawable/checkbox_theme" android:button="@null" android:gravity="center"/> </RadioGroup> </LinearLayout> But now when I make the buttons larger or smaller the text in it just disappears like this (height of the first image is 40sp, the second is 35sp and the last one is 30sp): How can I make the background image smaller without cutting the text in it?

    Read the article

  • how to access generated groupname for asp radiobutton

    - by rap-uvic
    Hi, I need to access radiobutton groupname in my jquery. However, groupname that's rendered for an asp radiobutton is kind of different. Example: <asp:RadioButton runat="server" GroupName="payment" ID="creditcard" Checked="true" value="creditcard" /> will generate: <input type="radio" checked="checked" value="creditcard" name="ctl00$ContentPlaceHolder1$payment" id="ctl00_ContentPlaceHolder1_creditcard"> I can't work with <%=creditcard.GroupName% in jquery. Is there a way I can get the generated groupname or name for it?

    Read the article

  • RadioButton and EditText inside ListView problem

    - by Sujit
    Hi I want to implement RadioButton and EditText inside ListView. I am using ArrayAdapter to set the List.But the problem is that when i am selecting a RadioButton and scroll down the list and again scroll up the the Radiobutton which had been selected getting unselected.Same with the EditText.The text getting removed when scroll up. hope you can understand........thanks in advance...

    Read the article

  • Is there a more efficient way to set variables on a RadioButton's CheckChanged event?

    - by C Patton
    I have 16 radio buttons in an application of mine.. I have to set a variable based on which one was selected.. and I've produced some very ugly code doing this.. private void Foo_CheckedChanged(object sender, EventArgs e) { convertSource = 1; } private void Bar_CheckedChanged(object sender, EventArgs e) { convertSource = 2; } private void Baz_RadioButton_CheckedChanged(object sender, EventArgs e) { convertSource = 3; } Now, I've been thinking about it and to be honest I thought there might have been a way to do it with a switch.. I just can't conceptualize it in my mind. If anyone could show me a more efficient way of doing this, I'd really appreciate it. It's just really bugging me that such a simple thing as this is taking up fifty to seventy lines of code. thanks, cpatton

    Read the article

  • Android RadioButton like Behaviour

    - by monxalo
    Greetings, I'm trying to create a single-choice android control, in a horizontal layout, by making use of the RadioGroup behaviour. I can assign the drawable just fine, but i would like to position the label of each RadioButton inside the drawable, is this possible using the standard APIs? <RadioGroup android:id="@+id/switchcontainer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:checkedButton="@+id/RadioButton02" android:padding="3dip"> <RadioButton android:text="id RadioButton02" android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/radio_button" android:paddingRight="2dip" /> <RadioButton android:text="@+id/RadioButton03" android:id="@+id/RadioButton03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/radio_button" android:paddingRight="2dip" />> </RadioGroup>

    Read the article

  • online quiz using ASP dot NET

    - by wacky_coder
    Hii, I need to develop an online quiz website that would be having MCQs. I would want to have one question appearing per page with a Numeric Pager so that the user can go back and forth. I tried using the FormView for displaying the questions and RadioButtons. I created a class QANS that would hold the answer selected by the user for the questions that he did answer so that I can later sum up the total Score. Now, the problem I'm facing is as below: Let the user select a RadioButton, say R, on a PageIndex, say I, and then go to some other page, say K. When the user returns back to page I, none of the RadioButtons is selected. I tried adding code for setting the Checked property of the RadioButton true in the Page_Load(), but it didn't help. I also tried the same with the PageIndexChanged and PageIndexChanging event, but the RadioButton doesn't get checked. The RadioButton that was selected for a particular question has been stored and I am able to print which one it was using Response.Write() but I'm not able to keep the RadioButton Checked. How shall this be done?

    Read the article

  • detect a postback from a radiobutton list

    - by user228777
    I am trying to detect a postback from Radiobutton list. I am trying to use following code: If Page.Request.Params.Get("__EVENTTARGET") = optDownload.UniqueID.ToString Then But Page.Request.Params.Get("__EVENTTARGET") returns "ctl00$ContentPlaceHolder1$pnlBarAccounts$i0$i2$i0$CHChecking$Acct1$optDownload$4" And = optDownload.UniqueID.ToString returns "ctl00$ContentPlaceHolder1$pnlBarAccounts$i0$i2$i0$CHChecking$Acct1$optDownload" There is a difference in last 2 characters, how do I detect a postback from Radiobutton list?

    Read the article

  • select (or click) specific radiobutton using jQuery

    - by Oleg Babanov
    I am trying to make specific radiobutton checked on page load and tried a lot of ways, but no one worked for me. This is a part of orderform on my webstore. <input type="radio" name="sPaymentCarrier" id="pC_2-1" value="1;2;0.00" onclick="countCarrierPrice( this )" /> <label for="pC_2-1">0</label> Actually this radiobutton is the only on radiobutton on page, and it must be checked to let user make order. I tried $(function() { var $radios = $('input:radio[name=sPaymentCarrier]'); if($radios.is(':checked') === false) { $radios.filter('[value=1;2;0.00]').attr('checked', true); } }); and $('input:radio[name="sPaymentCarrier"]').filter('[value="1;2;0.00"]').attr('checked', true); but none of these ways worked. Also I tried a lot of other codes, but when I refreshed page I still saw this button unchecked. I guess maybe I have to set up jquery click on this button instead of select, but actually I cannot make this work. Any help is appreciated!

    Read the article

  • ASP.NET MVC2 Radio Button generates duplicate HTML id-s

    - by Dmitriy Nagirnyak
    Hi, It seems that the default ASP.NET MVC2 Html helper generates duplicate HTML IDs when using code like this (EditorTemplates/UserType.ascx): <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<UserType>" %> <%: Html.RadioButton("", UserType.Primary, Model == UserType.Primary) %> <%: Html.RadioButton("", UserType.Standard, Model == UserType.Standard) %> <%: Html.RadioButton("", UserType.ReadOnly, Model == UserType.ReadOnly) %> The HTML it produces is: <input checked="checked" id="UserType" name="UserType" type="radio" value="Primary" /> <input id="UserType" name="UserType" type="radio" value="Standard" /> <input id="UserType" name="UserType" type="radio" value="ReadOnly" /> That clearly shows a problem. So I must be misusing the Helper or something. I can manually specify the id as html attribute but then I cannot guarantee it will be unique. So the question is how to make sure that the IDs generated by RadioButton helper are unique for each value and still preserve the conventions for generating those IDs (so nested models are respected? (Preferably not generating IDs manually.) Thanks, Dmitriy,

    Read the article

  • Radio Button with html.radiobutton ASP.NET MVC

    - by vikitor
    Hello, I'm a newbie to all this ASP.NET MVC stuff, and I was making some tests for my project. I wanted to ask how is it possible to introduce a javascript function call from the html.radiobutton function. For example, how would you declare this: <input type="radio" name = "Kingdom" value = "All" onclick="GetSelectedItem(this);" checked ="checked" /> with html.radiobutton. I've been looking for some documentation, but I don't really get to understand, I guess it has something to do with the html object attributes, but don't really know the syntax and I haven't found any example. Thank you all in advance :) vikitor

    Read the article

  • Can't check more than one RadioButton across multiple items in a Treeview

    - by Mike Johnston
    I’m using a TreeView control to present a list of Questions. Using the Prism.DataTemplateSelector, I'm loading a View (.xaml file) that represents a single Question into each node in the TreeView. In the View for that question is a ListBox containing RadioButtons (one for each item in a Picklist object that the ListBox is bound to). The radio buttons work as expected for the question, but when I check a RadioButton on another node/question in the TreeView, the check for the button in the Question I was editing before disappears. In other words, I'm only able to check one RadioButton in the whole list of Questions/Items bound to the containing TreeView. How do I group the RadioButtons in the ListBox to the scope of the single question instead of all the questions in the TreeView.

    Read the article

  • Android: How to make RadioGroup work correctly in a ListView?

    - by TianDong
    Hello! I have a ListView, which has a TextView and a RadioGroup with 4 RadioButtons as Children in each row. Now i can select a RadioButton in each row. But if i scroll the ListView, my Selection is gone or it does not showed correctly. For example, i choose the RadioButton A in the first row, if i scroll through the ListView and then go back to the first row again, either none of the RadioButtons in the RadioGroup is checked or RadioButton C is checked instead of A. How can i fix this Problem? I have tried 7 days already, but still i find no solution. Can anybody help me? I'll be very appriciate of that.

    Read the article

  • Can I un-check a group of RadioBottoms inside a group box?

    - by Claire Huang
    radio bottoms inside a group Box will be treated as a group of bottoms. They are mutual exclusive. How can I clean up their check states?? I have several radio bottoms, one of them are checked. How can I "clean" (uncheck) all radio bottoms?? "setChecked" doesn't work within a group, I tried to do following things but failed. My code is as following, radioButtom is inside a groupBox, and I want to unchecked it. The first setChecked does works, but the second one doesn't, the radioBottom doesn't been unchecked MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { QRadioButton *radioButton; ui->setupUi(this); radioButton->setChecked(true); radioButton->setChecked(false); } Where is the problem in my code?

    Read the article

  • Failing to add different items in combobox on dynamic radiobutton click

    - by Steven Wilson
    I am working on radiobuttons and combobox in my wpf App. Although I am a C++ developer, I recently moved to C#. My app deals with dynamic generation of the above mentioned components. Basically I have created 4 dynamic radiobuttons in my app and on clicking each, i should should add different items to my combobox. Here is the code: XAML: <ItemsControl ItemsSource="{Binding Children}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical" > <RadioButton Content="{Binding RadioBase}" Margin="0,10,0,0" IsChecked="{Binding BaseCheck}" GroupName="SlotGroup" Height="15" Width="80" HorizontalAlignment="Center" VerticalAlignment="Center"/> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <ComboBox Visibility="{Binding IsRegisterItemsVisible}" ItemsSource="{Binding RegComboList}" SelectedItem="{Binding SelectedRegComboList, Mode=TwoWay}" SelectedIndex="0" /> FPGARadioWidgetViewModel Class: public ObservableCollection<FPGAViewModel> Children { get; set; } public FPGARadioWidgetViewModel() { Children = new ObservableCollection<FPGAViewModel>(); Children.Add(new FPGAViewModel() { RadioBase = "Base 0x0", ID = 0 }); Children.Add(new FPGAViewModel() { RadioBase = "Base 0x40", ID = 1 }); Children.Add(new FPGAViewModel() { RadioBase = "Base 0x80", ID = 2 }); Children.Add(new FPGAViewModel() { RadioBase = "Base 0xc0", ID = 3 }); } FPGAViewModel Class: private bool sBaseCheck; public bool BaseCheck { get { return this.sBaseCheck; } set { this.sBaseCheck = value; AddComboItems(); this.OnPropertyChanged("BaseCheck"); } } private ObservableCollection<string> _RegComboList; public ObservableCollection<string> RegComboList { get { return _RegComboList; } set { _RegComboList = value; OnPropertyChanged("RegComboList"); } } private void AddComboItems() { int baseRegister = 0x40 * ID; ObservableCollection<string> combo = new ObservableCollection<string>(); for (int i = 0; i < 0x40; i++) { int reg = (i * 8) + baseRegister; combo[i] = "0x" + reg.ToString("X"); } RegComboList = new ObservableCollection<String>(combo); OnPropertyChanged("RegComboList"); } private bool isRegisterItemsVisible = false; public bool IsRegisterItemsVisible { get { return isRegisterItemsVisible; } set { isRegisterItemsVisible = value; OnPropertyChanged("IsRegisterItemsVisible"); OnPropertyChanged("RegComboList"); } } If you notice, on clicking a particular radiobutton, it should add items with different value in combobox based on ID. It has to be made sure that on clicking any radiobutton only the items of that should be added and previous content of combobox should be cleared. I am trying to do the same thing using my above code but nothing seems to appear in combobox when i debug. Please help :)

    Read the article

  • Make my radio buttons become selected in Android

    - by NickTFried
    When I run this could and click on the dialog box my radiobuttons do not become selected like intended package edu.elon.cs.mobile; import edu.elon.cs.mobile.R; import edu.elon.cs.mobile.R.id; import edu.elon.cs.mobile.R.layout; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.text.Editable; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.RadioButton; import android.widget.TextView; import android.widget.Toast; public class PTCalculator extends Activity{ private RadioButton maleRadioButton; private RadioButton femaleRadioButton; private EditText ageEdit; private EditText pushUpsEdit; private EditText sitUpsEdit; private EditText mileMinEdit; private EditText mileSecEdit; private Button calculate; private TextView score; protected AlertDialog genderAlert; private int currScore; private int age; private int sitUps; private int runTime; private int pushUps; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pt); maleRadioButton = (RadioButton) findViewById(R.id.male); femaleRadioButton = (RadioButton) findViewById(R.id.female); ageEdit = (EditText) findViewById(R.id.ageEdit); pushUpsEdit = (EditText) findViewById(R.id.pushupEdit); sitUpsEdit = (EditText) findViewById(R.id.situpEdit); mileMinEdit = (EditText) findViewById(R.id.minEdit); mileSecEdit = (EditText) findViewById(R.id.secEdit); calculate = (Button) findViewById(R.id.calculateButton); calculate.setOnClickListener(calculateButtonListener); score = (TextView) findViewById(R.id.scoreView); genderAlert = makeGenderDialog().create(); } private OnClickListener calculateButtonListener = new OnClickListener() { @Override public void onClick(View arg0) { age = (Integer.parseInt(ageEdit.getText().toString())); pushUps = (Integer.parseInt(pushUpsEdit.getText().toString())); sitUps = (Integer.parseInt(sitUpsEdit.getText().toString())); int min = (Integer.parseInt(mileMinEdit.getText().toString())*60); int sec = (Integer.parseInt(mileSecEdit.getText().toString())); runTime = min + sec; if(maleRadioButton.isChecked()){ MalePTTest mPTTest = new MalePTTest(age, pushUps, sitUps, runTime); currScore = mPTTest.malePTScore(); score.setText((Integer.toString(currScore))); }else if(femaleRadioButton.isChecked()){ FemalePTTest fPTTest = new FemalePTTest(age, pushUps, sitUps, runTime); currScore = fPTTest.femalePTScore(); score.setText((Integer.toString(currScore))); }else genderAlert.show(); } }; public AlertDialog.Builder makeGenderDialog(){ AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("Select a Gender") .setCancelable(false) .setPositiveButton("Female", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { femaleRadioButton.setSelected(true); FemalePTTest fPTTest = new FemalePTTest(age, pushUps, sitUps, runTime); currScore = fPTTest.femalePTScore(); score.setText((Integer.toString(currScore))); } }) .setNegativeButton("Male", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { maleRadioButton.setSelected(true); MalePTTest mPTTest = new MalePTTest(age, pushUps, sitUps, runTime); currScore = mPTTest.malePTScore(); score.setText((Integer.toString(currScore))); } }); return builder; } } Any suggestions?

    Read the article

  • RadioButtonGroup with each RadioButton added in components?

    - by futureal
    Hi, Working in Flex 3, I have a series of components being rendered on a canvas, each of which should represent a single potential selection, ideally in a RadioButtonGroup. So in my parent canvas I am defining the RadioButtonGroup, and each component provides a single RadioButton. However, this doesn't seem to work. Suppose there is a component called aComponent defined as such: <mx:Canvas ...> ... <mx:RadioButton id="someButton" groupName="myRadioButtonGroup" ... /> </mx:Canvas> The outer canvas: <mx:Canvas ...> ... <mx:Script> public function doesSomething():void { var myComponent:aComponent = new aComponent(); outerCanvas.addChild(myComponent); } </mx:Script> ... <mx:RadioButtonGroup id="myRadioButtonGroup" /> </mx:Canvas> So my guess was that at this point if, say, four of these components were added, the radio buttons would behave in mutually exclusive fashion and I'd be able to access myRadioButtonGroup.selectedValue to get the current selection. However, it doesn't seem to work that way. Is what I'm trying to do even possible, or have I maybe just missed something? Thanks!

    Read the article

  • how to control radiobutton from textfield

    - by klox
    i want after i type "0203-ED" in textfield ...two character behind that text can control the radio button.. "ED" character from that text can make one radiobutton which has value="ED" are checked... what script that can make it work??

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >