How to check radio button as default on the basis of database value?
Hi Friends,
I have one jsp, in which I am having a field of radio button, which have two boolean values of 0 & 1. I want to check the radio button as default on the basis of database value, kindly help me out.
Thanks a lot in advance. Please help me out.
probably, when using struts you should do all your calculations in action class it self
Eg. in jsp
<html:radio name="myForm" property="myProperty" value="0">0</html:radio>
<html:radio name="myForm" property="myProperty" value="1">1</html:radio>
in Action class
if (databaseValue == 0)myForm.setMyProperty(0);
else if (databaseValue == 1)myForm.setMyProperty(1);
rest will follow
whatever be the value it will come selected
Similar Messages
-
How to display Radio buttons with default selection on
Hi
I want to display Radio buttons using jsf
i have done it using
<h:dataTable id="apartmentList" value="#{userBean.allApartmentList}"
var="apartments">
<h:column>
<h:selectOneRadio id="selectedApartment" onclick="javascript:setSelectedApartment(this);">
<f:selectItem itemValue="#{apartments.apartmentVO.apartmentId}" />
</h:selectOneRadio>
</h:column>
inside a data table
now when i click some page i want to display the radio's with default radio button selected
also when i select one radio button and click on some command button
eg:<h:commandButton action="#{userBean.setSelectedApartment}"
the Radio button's Selection should not disappear
i have written a javaScript
function setSelectedApartment(oRadio)
oForm = oRadio.form;
elems=oForm.elements;
for(iIndex=0;iIndex<elems.length;iIndex++)
if(elems[iIndex].type == 'radio')
if(elems[iIndex].name != oRadio.name)
elems[iIndex].checked=false;
document.getElementById("apartmentListForm:selectedApartmentId").value=oRadio.value;
To check which Raio button is Selected
How do i show the Default Selected button and How the selection should not disappear
Can any one suggest me links or the solution to this problem
Thank you
Geetanjalee-set the value binding expression of select items to a request scope bean
- on the page load event() ,do
setdefaultval("ur default value")
so each time on the page load it sets the default value. and you can get selected value by getdefaultval()
--raju -
How to check Radio buttons with Differfent button values
Good Day,
I am currently trying to write a script that would hide 5 of 6 radio buttons
I have a radio button called "3. Transfer"
with values of :
Yes;
Supp;
Reg; and
do_not_transfer
as well I have a drop down called "REL.ITEM"
with values of
3(A);
3(B);
4(A);
4(B); and
4(C)
I know how to get the value of the box and manipulate other fields
like
//START
var transfer = getField("3. Transfer").value
var relitem = getField("REL.ITEM").value
if (transfer = "Yes" || transfer = "Supp") && (relitem == "4(C)" || relitem == "4(B)"))
getField("a. recommend").checkThisBox(0,true);
getField("a. recommend").display = display.visible
getField("a. I do not recommend").checkThisBox(0,false);
getField("a. I do not recommend").display = display.hidden
else if (transfer = "do_not_transfer")
getField("a. recommend").checkThisBox(0,false);
getField("a. recommend").display = display.hidden
getField("a. I do not recommend").checkThisBox(0,ftrue);
getField("a. I do not recommend").display = display.visible
//END
I would like to make it so that if REL.ITEM != 4(A); 4(B); 4(C) that the radio box's with values of "Yes", "Supp" and "Reg" are hidden while "do_not_transfer" is still displayed and checked.
I've been going through forums, google and acrobat documentation and I can't seem to find what I'm looking for.
Thanks for your help in advance.if (transfer = "Yes" || transfer = "Supp") && (relitem == "4(C)" || relitem == "4(B)"))
This should be:
if ((transfer == "Yes" || transfer == "Supp") && (relitem == "4(C)" || relitem == "4(B)"))
Similarly,
else if (transfer = "do_not_transfer")
should be:
else if (transfer == "do_not_transfer")
In order to work with an individual widgets of a form field, obtain an object that represents the widget using the getField method as specifically demonstrated in example #2 in the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.476.html -
How to check radio button on view layout?
Hi All,
How to check on view layout whether a radiobutton is checked or not?
Thanks & Regards,
Rahul RathiUse the below in layout, it should work..
<%
DATA: rbg TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
rbg ?= CL_HTMLB_MANAGER=>GET_DATA( request = request id = 'radio_id' name = 'radioButtonGroup' ).
%>
Here rbg->selection will have the selected radiobutton.
<i>*Reward each useful answer</i>
Raja T -
How to define RADIO BUTTONS in MODULE POOL PROG.?
Hi Experts,
I need to keep the RADIO BUTTONS in 1000_screen of my_module_pool prog., like,
I hv 2 fields in this screen, as expected, the first shuld hv DEFAULT selection.
So, I just simply, dragged & dropped 2 radio buttons from left menu of the screen builder & given them the names as
R_SUMMARY
R_DETAIL
Then i executed the transaction, but, these above 2 fields are getting selected, as default??
I know that, if its a REPORT prog. we can define as w/ a GROUP, then the 1st one is hv the default selection.
so,
1 - How to define RADIO BUTTONS in this screen of a module pool prog.
2 - How to use these names in the prog.(PAI - i guess)?
thanq
Edited by: Srinivas on Jul 12, 2008 11:59 PMHi Srinivas,
Please check this link
Re: urgent:Regd radio buttons in module pool
http://saplab.blogspot.com/2007/10/sample-abap-program-for-module-pool_18.html
http://****************/Tutorials/ABAP/Checkbox/page1.htm
http://****************/Tutorials/ABAP/Checkbox/page2.htm
Best regards,
raam -
How to handle Radio buttons on screen.(urgant)
Dear all,
my req is : i had a screen , on that there are 3 radio buttons,Based on the radion button selection on that screen i've to trigger the 3 select statements.
if Radio button 1
execute select stmt 1.
if Radio button 2
execute select stmt 2.
if Radio button 3
execute select stmt 3.
how to write this and where.
Pls frnds this is urgant for me.
please help me,
Thanks in advance,
With regards,
Ajay Kumar K,
9908979994.hiii....
you have to remember that you have to define the radio buttons in 1 group.because if changes are made in the group from the elements list then it would affect on all the radio buttons for a particular tasks.
again radio buttons are always been declared with the parameter statements.
for eg..
Parameters:
p_rad1 radiobutton group rad1 default 'X' user-command rad1,
p_rad2 radiobutton group rad1,
p_rad3 radiobutton group rad1.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
IF p_rad1 = 'X'.
select statement 1.
elseif p_rad2 = 'X'.
select statement 2.
elseif p_rad3 = 'X'.
select statement 3.
endif.
The group group over here is RAD1.
the default radio button over here is in radio button 1. you can also also check any of the radio buttons as default.
thanks..
any more help pzz revert back... -
How to create radio button between two slection screen
hello all.
could you please guide me how to create radio button between two SELECTION-SCREEN in screen painter.
Thank you,
srinivashi
SEE THIS CODE
REPORT ZNNR_REPORT NO STANDARD PAGE HEADING MESSAGE-ID ZNNR LINE-SIZE 100 LINE-COUNT 65(4).
******DATA DECLARATIONS**********
DATA : BEGIN OF IT_PLANT OCCURS 0,
MATNR LIKE MARA-MATNR,
WERKS LIKE MARC-WERKS,
PSTAT LIKE MARC-PSTAT,
EKGRP LIKE MARC-EKGRP,
END OF IT_PLANT.
DATA : BEGIN OF IT_PONO OCCURS 0,
EBELN LIKE EKKO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
END OF IT_PONO.
TABLES EKKO.
********END OF DATA DECLARATIONS*********
********SELECTION SCREEN DESIGN ***********
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.
SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R3 RADIOBUTTON GROUP G2 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R3.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R4 RADIOBUTTON GROUP G2.
SELECTION-SCREEN COMMENT 5(20) TEXT-004 FOR FIELD R4.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
******END OF SELECTION SCREEN DESIGN****************
<b>rEWARD IF USEFULL</b> -
How to create radio button in reports
Hi Friends,
Can any body please tell how to create radio button in reports.
Thanks,
NagendraHi Nagendra,
But why do u need a single radio button, any specific reason...
try this
REPORT ZCHA1.
PARAMETERS : P_RAD1 RADIOBUTTON GROUP RAD,
P_RAD2 RADIOBUTTON GROUP RAD.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_RAD2'.
SCREEN-INVISIBLE = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP. -
How to unselect Radio Button in VC
Hi all,
I have set of questions with radio button. I can select different values from radio button for different questions. I select one value (Ex: good) from radio button and then if i click Next button the value of the radio button is not refreshed . It shows the same value what i have selected before that. How can i unselect the radio button for next questions?
Help me in this regard.
Thanks & Regards,
Hemalatha JHi Basheer,
Ya, I am using single radio button Group and Single Form. I changed question field by doing system action of button(select Row action).
Thanks & Regards,
Hemalatha J -
I have a very common use case where you have a few radio buttons and only one can be selected at a time. Some of them are basic and on click should be selected right away, but other are more complex and open a pop up which requires some additional user selections after which the user selected OK or CANCEL for example and only after that the selection of the radio button should be applied programatically.
So to solve this issue I've come up with 2 workarounds:
1) make the entire group, that holds the radio button, act as a button with buttonMode="true" mouseChildren="false" and programatically change the radio button within it.
2) hold the current radio button selection in a variable and in the changeHandler of that radio button return the selection back to what was selected before. But this also causes a small flickering of the radio button which gets selected and deselected immediately after that.. not cool.
So my question is... is there something I am missing that could do the job without these workarounds... like a Changing event which I use for the ButtonBar but I can't find on the RadioButton or RadioButtonGroup... thanks!Hi,thanks for the reply. Actually that was my third option, but not sure if it's very good also..
Here is a simple scenario:
User must select between 2 radio buttons:
1) no volume -> sets variable volume=0 and selects the radio button (that is the normal use case)
2) set volume -> opens up a pop up with a list that has a X button to close and 4 options: 25% volume, 50% volume, 75%, 100%
At this point the set volume radio button should not be selected and the user has 2 choices:
-> hit the X button to close - nothing changes and no volume radio button is still selected and volume is still = 0
-> hit one of the volume % buttons -> the set volume radio button gets selected and the variable volume=25/50/75/100 depending on the button selected by the user.
That's a pretty common scenario and it's bugging me that I can't easily alter the radio button selection logic since whenever I click it, it gets selected and I can't put a logic in between in a standard way. This should apply to any component with selection, just like ButtonBar has it with the Changing event.
So is there any other more convenient way to accomplish this scenario that you could recommend?
Thanks! -
How Can I Set Photoshop to Default Open the Most Recent Folder
Lately, Photoshop CC always opens a default folder-which is several clicks away from the folder I am using. How do I set it to default to the most recent open folder when I click "OPEN" ?
They would seem to be, but it's possible that they were released separately in the iTunes Store. Some apps are different but named the same (Angry Birds being a case in point). Not having any of those apps I can't say with any certainty. It's definitely not normal for iTunes to keep older versions.
If you're still on Mac OS X 10.5.6 as your profile indicates, update to 10.5.8 and the latest version of iTunes and see if that makes any difference.
Regards. -
How to check whether any table(s) required to shrink on database
Hi,
How to check whether any table(s) required to shrink on database
Regards,
VenkatVenkat wrote:
Hi,
Thi is Oracle 10g. How to use this?. I am not using toad etc...
I am on SQL prompt.
Regards,
Venkat.
for starter
Generate Script to Shrink Segment Advisor Recommendations [ID 1171054.1]
Automatic Segment Advisor in Oracle 10g Release 2 (10.2) [ID 314112.1]
10g and above SEGMENT ADVISOR [ID 242736.1]
Cheers -
How to check whether a file exist in the program folder or not?
Hi guys,
how to check whether a file exist in the program folder or not? Let is say i recieve a file name from user then i want to know if the file is there not and act on that base.
abdulLook at the class java.io.File and the .exists() method:
http://java.sun.com/j2se/1.4/docs/api/java/io/File.html -
CRM Survey - How to remove Radio button defaults.
Hi experts,
I am trying to remove Radio button default. By default it is selected when I am trying to set attribute for answer options. Even if I unchecked, it reverts and set as selected again. Actually, I need remove Radio button default for the customer sees a response pre filled.
Please advise on how can I remove Radio button default for answer options.
BanuHi,
I see it now.
You need to change the config of your radio buttons in the transaction itself.
Goto CRM_SURVEY_SUITE, locate your survey, click on the change button ( a pencil) this will take you to the survey configuration.
There navigation to the section in the left hand pane that corresponds to the radio buttons. And you will see Yes and No for answers to the questions. Double click on each of them to display on the right side work area and change the property 'Selected' (which is a check box) to unchecked.
This should be easy.
Regards
Prasenjit -
How to change the "Address is Residential" radio button to default "off"
Hello, I am attempting to set the "Address is Residential" radio button under UPS shipping option to default "off". Our company sells mainly to business locations, and the button is causing confusion and incorrect shipping rates with our customers. Sorry if this has been covered before, I have seen a few discussions when googling the topic, however their links are not working.
Thanks!Hi,
The option cannot be changed but a possible workaround to avoid client confusion is to hide this div, using some custom JavaScript script that will hide it after is rendered by the shipping option tag.
Unfortunately I do not have the exact script but will leave this topic open for the community to assist if possible.
Kind regards,
-Sidney
Maybe you are looking for
-
Hi Guys, I have a PXIe system, currently running in RT. Now, there is a requirement for the PXIe system to have up to graphic output to control some instruments. I came across these cPCI cards: 1. http://ekf.de/s/sv1/sv1.html 2. http://ekf.de/c/cgxa/
-
I lost all my songs when syncing
When I downloaded the new version I lost all my contacts and all my apps and all my downloaded songs. I've managed to get everthing else back except for the music. I had approximately 150 songs. Any help would be greatly apreciated. Thanks,
-
I recall iOS 5 had an option to increase the font size of the mail content but in iOS 6 it seems to have been taken away. I know there's a way to increase font size from the accessibility option but that doesn't apply to email. Any suggestions how I
-
Anyone able to advise how to trace the serial number of my macbook pro that was stolen, I used it to purchase from iTunes and i have a Time machine with back up info. It was bought in 2009 and i cannot find my receipts for the police but need to prov
-
Hello I have a new X3 Compact phone which I got a few days ago. I cannot sync email accounts on it (which is very easy to do on iphone and blackberry). The error message is "could not open connection to server". I have read your troubleshooting adv