radio-group

how to pull selected radio button in a jsp

让人想犯罪 __ 提交于 2021-02-16 20:18:19
问题 I have two radio buttons, and depending on which one is selected I want to send them to a specific jsp page. I do not know how to pull which button is selected in my java class. Here is the jsp: <form method="post" action="ttp.actions.Sale1Action.action"> <input type="radio" name="radio1" value="packages"checked> packages<br> <input type="radio" name="radio1" value="productions"> productions<br> <input type="submit" value=" next "/> </form> here is the java: public class Sale2Action

Android RdioGroup clearCheck conflict with setOnCheckedChangeListener

时间秒杀一切 提交于 2021-01-28 10:34:47
问题 I'm trying to take an action when a radio button clicked: dataBinding.radioGroup.setOnCheckedChangeListener { radioGroup: RadioGroup, i: Int -> if( radioGroup.checkedRadioButtonId != -1){ checkAnswer(i) } } inside another function there is a clearCheck to clear radio button . the issue is that every time clearCheck is called, the listener setOnCheckedChangeListener also called. is there any way to run the listener to get run when a radio button is selected and not when it is cleared? 回答1: /**

Android RdioGroup clearCheck conflict with setOnCheckedChangeListener

本秂侑毒 提交于 2021-01-28 10:30:43
问题 I'm trying to take an action when a radio button clicked: dataBinding.radioGroup.setOnCheckedChangeListener { radioGroup: RadioGroup, i: Int -> if( radioGroup.checkedRadioButtonId != -1){ checkAnswer(i) } } inside another function there is a clearCheck to clear radio button . the issue is that every time clearCheck is called, the listener setOnCheckedChangeListener also called. is there any way to run the listener to get run when a radio button is selected and not when it is cleared? 回答1: /**

Radio button checked by itself when scrolling

我与影子孤独终老i 提交于 2020-05-15 09:26:38
问题 I made a RecyclerView that shows 32 question and 4 answers as RadioButton s. When I click a single radio button, it works, and I show a toast when it is checked. But when I scroll the RecyclerView`, it shows toasts like I checked a radio button. How do I fix it? My adapter: public class sikapadapter extends RecyclerView.Adapter<sikapadapter.ViewHolder> { private int[] integer; String option[]; private OnRadioChangeListener onRadioChangeListener; public sikapadapter(String[] option,

RadioGroup doesnt keep properly state in ListView

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-24 12:15:12
问题 I know about ListView recycling issue and try to keep my state in model, but it seems not to work. I've read many topics with the same problem, but their solutions dont work for me, or I do something wrong. When I scroll up and down the list view with radio group in initial state, nothing happens, that's right. But as soon as I set checked any radio button in any row and then scroll it up and down radio buttons become checked randomly. RadioAdapter.java: public class RadioAdapter extends

I can't create an onCheckedChanged listener for my RadioGroup

杀马特。学长 韩版系。学妹 提交于 2020-01-11 13:18:11
问题 I'm trying to create an onCheckedChanged Listener for my RadioGroup, but eclipse is throwing erros at me. this is the code rg = (RadioGroup) findViewById(R.id.radioGroup1); rg.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { Log.d("chk", "id" + checkedId); if (checkedId == R.id.switchToFriends) { // some code } else if (checkedId == R.id.switchToUsers) { // some code } } }); And from eclipse I get an error on

Android - cannot cast android.widget.RadioGroup to android.widget.RadioButton

别等时光非礼了梦想. 提交于 2020-01-07 00:34:45
问题 This question is similar to this one but this question is little bit different. I am creating 15 RadioGroups and 4 radio buttons inside each group using for loop. for(int i=0; i<15; i++) { RadioGroup radioGroup = new RadioGroup(getActivity()); radioGroup.setOrientation(RadioGroup.HORIZONTAL); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f); radioGroup.setLayoutParams(lp); radioGroup.setId(i+1);

Android - cannot cast android.widget.RadioGroup to android.widget.RadioButton

故事扮演 提交于 2020-01-07 00:34:32
问题 This question is similar to this one but this question is little bit different. I am creating 15 RadioGroups and 4 radio buttons inside each group using for loop. for(int i=0; i<15; i++) { RadioGroup radioGroup = new RadioGroup(getActivity()); radioGroup.setOrientation(RadioGroup.HORIZONTAL); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f); radioGroup.setLayoutParams(lp); radioGroup.setId(i+1);

How to bind Radio Buttons using RxJava

拥有回忆 提交于 2020-01-06 20:01:48
问题 I'm following the code of the Qiitanium app (See the highlighted lines in link) and I have trouble figuring out how I can bind RadioButtons Say I have a RadioGroup with R.id.rgMyButtons as Id and it contains 3 RadioButtons "Dead", "Alive", "Body Missing" with Ids are R.id.rbDead, R.id.rbAlive, R.id.rbMissing I set the RadioGroup field as Rx<RadioGroup> radioGroup; I get the view set in onViewCreated as rdGroup = RxView.findById(this, R.id.rgMyButtons); rdGroup.get().setOnCheckedChangeListener

Radio-group on different ion-radio in same division angular 2 ionic 2

不羁岁月 提交于 2020-01-06 06:47:26
问题 I have created an ion-grid radio-group in which there are ion-rows and in ion-rows there are 3 ion-cols in each ion-row and in last 2 ion-col I've put ion-radios . like this <ion-grid class = "DiscountOptions" radio-group> <ion-row style = "border: 1px solid; padding: 8px; background-color: #84AEF9"> <ion-col>Discount Options</ion-col> </ion-row> <ion-row> <ion-col>Pay 100% of fee now & get 25% discount</ion-col> <ion-col class = "euro"><ion-radio></ion-radio> €25.0%</ion-col> <ion-col class