How to link a radio button selection to a submit destination ?
Hi,
I am working on a JSP page. Depending on the check from a radio button on a form, the form will be submitted to a different destination. Does anyone know how to do that? Any code samples?
Thanks!
wyp
This will give you an idea of how it works. Save the file and double click on it to open in IE.
<html>
<head></head>
<body>
<form name="myForm" method="GET" action="servlet/InsertRecords">
<P>
<INPUT TYPE="RADIO" NAME="Radio1" VALUE="1" onClick="onClickFunction(1)" >Insert Record
<BR>
<INPUT TYPE="RADIO" NAME="Radio1" VALUE="2" onClick="onClickFunction(2)" >Delete Record
<BR>
</P>
</form>
</body>
<Script Language="JavaScript">
function onClickFunction(inVar) {
if (inVar == 1) { document.myForm.action="servlet/InsertRecords";
document.myForm.submit(); }
if (inVar == 2) { document.myForm.action="servlet/DeleteRecords";
document.myForm.submit(); }
</script>
</html>
Similar Messages
-
Linking a radio button to a text field in a pdf form
Forgive my ignorance but does anyone know how to link a radio button to a text field in an Acobat pdf form?
I have a series of 4 radio buttons. If you click on one of them I would like to activate a text field which you then have to fill in. In addition it would be good to have it so that if you don't click on the radio button you're not able to fill in the associated text box.
I am a designer not a programmer so I don't know much about javascript. Can anyone help?
Many thanksYou might want to look at Hiding and Showing Form Fields by Thom Parker. You might also want to clear the text field when the radio button changes.
-
Clearing radio button selection
Guys, iam stuck in a situation where iam not able to clear the radio button selection in the SINGLESELECT tableview. I am using MVC approach and my layout is similar to bookshop example in SAP tutorial_4_mvc.
I found that even in the SAP example the raio button is not cleared when a new search is used. The radio button remains selected and it has to be clicked again to refresh and retrieve new values. But I would like to clear the selection.
Any help on how to clear previous radio button selection every time the page is reloaded?
Thanks.hi,
i tried this but for some reason the index of the prviously selected row still gets applied to the new selection and is checked.
in my do_handle_event:
IF htmlb_event IS BOUND AND
htmlb_event->name = 'tableView'.
table_event ?= htmlb_event.
selectedrowindex = table_event->selectedrowindex.
READ TABLE i_result INDEX selectedrowindex INTO wa.
IF sy-subrc EQ 0.
CLEAR: imatfact1, iagrfact1, iagrhead1, iabgru1, v_part_detail,
selectedrowindex.
processing data
ENDIF.
In my DO_REQUEST:
result_view->set_attribute( name = 'i_result' value = i_result ).
result_view->set_attribute( name = 'iterator' value = me ).
result_view->set_attribute( name = 'selectedrowindex' value =
selectedrowindex ).
call_view( result_view ).
In my page:
<htmlb:tableView id = "result"
headerText = "Header Text"
onNavigate = "onMyNavigate"
selectionMode = "<%= v_sel_mode %>"
emptyTableText = "No data found matching your query!"
onRowSelection = "<%= v_onrow_sel %>"
table = "<%= i_result %>"
iterator = "<%= iterator %>"
visibleRowCount = "10"
selectedRowIndex = "<%= selectedrowindex %>">
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName = "MATNR"
width = "100"
horizontalAlignment = "left"
title = "PART" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "ZFLAG"
width = "100"
horizontalAlignment = "left"
title = "DISCOUNT" >
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
I am also using the interface methods u tthere is no code inside:
IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS
IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START
IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
Please suggest what could be wrong.
I have debugged this and saw the selected rowindex as '0' also but it gets applied somewhere again.
Thanks. -
How to get Radio button select event in my co
Hi,
I want to get the radio button selection event in my co,how can i get the event?Hi,
841475 wrote:
I want to get the radio button selection event in my co,how can i get the event?---There is no event for radio button.
---U need to explicitily set the event for the radio button.
Action:FirePaatialAction
Event:RadioEvent---Get the event in co by below code:
if("RadioEvent".equals(pageContext.getParameter(EVENT_PARAM)))
---In radio button event..:)
Regards
Meher Irk -
How to detect which radio button is selected in Forms?
I created a Form with two radio buttons, one for Male and one for Female.
I created a Push Button with WHEN-BUTTON-PRESSED to display the selected radio button as a DIsplay Item on the same Form.
Can any one give me some hints?
(0) Male
( ) Female
[Submit]
When the [Submit] button is pressed, I would like to display:
You are a man. (if Radio button selected is Male)
You are a woman (if Radio button selected is Female)create item RG with property record group in block2
add two button in this group (rg1 and rg2)
assign value to above two buttons
rg1 M (Male)
rg2 F (Female)
assign initial value to RG Say M
You can use this item as :block2.RG in Save Button. -
Using radio button selection in multiple tables
Hello All,
I've got a bit of a design issue and it being a Friday my brain is a bit foggy and I can't seem to figure out a solution.
what I want to do is have 3 tables. The user should only be able to select one line from any of the three tables.
I can do this by having events that clear down selection on the two other tables on any selection of the third, but the select buttons of tables don't really give the UI impression that only one row can be selected. To do this I'd like to use the radio button element.
so
table A
choice - name
(o) - Anne
(o) - Bob
(o) - Charlie
Table B
choice - name
(x) - David
(o) - Ellen
(o) - Fran
Table C
choice - name
(o) - George
Here the entry in table B for David is selected. But any selection of any of the other options should deselected.
My thoughts are to use a radio button ui element, bind the "selected" value to a unique id for each row/table (an attribute of the node element for each table) and the value to a common shared attribute (not table specific).
Any better ideas - and certainly any which would mean I'm not going to have to maintain a lookup table of my unique ids and node elements to find out which one is selected?
Cheers,
ChrisOk - here's how I did it.
I created another lookup table which had a guid and reference to the element.
in the each elements I had a guid which I bound to the key for selection property of the radio button in the table.
I then bound the selected key property to an attribute that was common to all elements.
in my "processing" logic I read the selected key, read the lookup table - and therefore got the reference to the selected element.
Would have been an awful lot easier if I could have used a reference to the element itself as the "key" - but that was required to be a character field.
[image showing radio button selection working across multiple tables|http://i51.tinypic.com/bi79dx.jpg]
End result works quite nicely.
Cheers,
Chris -
How to use a radio button in enabling/disabling a text box in report progra
Hi,
Could any please let me know, how to use a radio button in enabling/disabling a text box in report program.*& Report ZMR_RADIO_BUTTONS
REPORT ZMR_RADIO_BUTTONS.
PARAMETERS : R1 RADIOBUTTON GROUP G1,
R2 RADIOBUTTON GROUP G1.
PARAMETERS : A1 TYPE I,
A2 TYPE I.
AT SELECTION-SCREEN OUTPUT.
*initialization.
IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'A1'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDIF.
IF SCREEN-NAME = 'A2'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
ENDIF.
ENDLOOP.
ENDIF.
IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'A1'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
ENDIF.
IF SCREEN-NAME = 'A2'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDIF.
modify screen.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
*IF R1 = 'X'.
*LOOP AT SCREEN.
IF SCREEN-NAME = 'A1'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
ENDIF.
*ENDLOOP.
*ENDIF.
*IF R2 = 'X'.
*LOOP AT SCREEN.
IF SCREEN-NAME = 'A2'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDIF.
*ENDLOOP.
*ENDIF. -
How to create a radio button in ALV Reports
Hi all,
Best wishes to all..
Kindly reply me to this question... that is "How to create a radio button in ALV Report"
Thanks and Regards
AnjaliHI
here is an example :
PROGRAM ZUS_SDN_BCALV_GRID_DEMO_2.
Based on: BCALV_GRID_DEMO.
TYPE-POOLS: icon.
TYPES: BEGIN OF ty_s_sflight.
INCLUDE TYPE sflight.
TYPES: button1 TYPE lvc_emphsz.
TYPES: button2 TYPE lvc_emphsz.
TYPES: button3 TYPE lvc_emphsz.
TYPES: button4 TYPE lvc_emphsz.
TYPES: END OF ty_s_sflight.
DATA:
gt_sflight TYPE STANDARD TABLE OF ty_s_sflight,
gt_fcat TYPE lvc_t_fcat.
DATA: ok_code LIKE sy-ucomm,
gt_sflight TYPE TABLE OF sflight,
g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
md_cnt TYPE i.
CLASS-METHODS:
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING
e_row_id
e_column_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_hotspot_click.
define local data
FIELD-SYMBOLS:
<ls_entry> TYPE ty_s_sflight,
<ld_fld> TYPE ANY.
READ TABLE gt_sflight ASSIGNING <ls_entry> INDEX es_row_no-row_id.
CHECK ( <ls_entry> IS ASSIGNED ).
Set all radio buttons "unselected"
<ls_entry>-button1 = icon_wd_radio_button_empty.
<ls_entry>-button2 = icon_wd_radio_button_empty.
<ls_entry>-button3 = icon_wd_radio_button_empty.
<ls_entry>-button4 = icon_wd_radio_button_empty.
ASSIGN COMPONENT e_column_id-fieldname OF STRUCTURE <ls_entry>
TO <ld_fld>.
IF ( <ld_fld> IS ASSIGNED ).
Set selected radio button "selected".
<ld_fld> = icon_wd_radio_button.
ENDIF.
Force PAI followed by refresh of table display in PBO
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DUMMY'
IMPORTING
RC =
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
MAIN *
PERFORM select_data.
CALL SCREEN 100.
MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
CREATE OBJECT grid1
EXPORTING i_parent = g_custom_container.
PERFORM build_fieldcatalog.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_fieldcatalog = gt_fcat
it_outtab = gt_sflight.
Set event handler for event TOOLBAR
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR grid1.
else.
CALL METHOD grid1->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
FINISHED = 1
others = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDMODULE. "PBO OUTPUT
MODULE PAI INPUT *
MODULE pai INPUT.
to react on oi_custom_events:
CALL METHOD cl_gui_cfw=>dispatch.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN OTHERS.
do nothing
ENDCASE.
CLEAR ok_code.
ENDMODULE. "PAI INPUT
FORM EXIT_PROGRAM *
FORM exit_program.
CALL METHOD G_CUSTOM_CONTAINER->FREE.
CALL METHOD CL_GUI_CFW=>FLUSH.
LEAVE PROGRAM.
ENDFORM. "EXIT_PROGRAM
*& Form BUILD_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM build_fieldcatalog .
define local data
DATA:
ls_fcat TYPE lvc_s_fcat,
ls_hype TYPE lvc_s_hype.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'LVC_S_FCAT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DELETE gt_fcat WHERE ( fieldname <> 'EMPHASIZE' ).
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE gt_fcat INTO ls_fcat
WITH KEY fieldname = 'EMPHASIZE'.
IF ( syst-subrc = 0 ).
DELETE gt_fcat INDEX syst-tabix.
ENDIF.
ls_fcat-fieldname = 'BUTTON4'.
ls_fcat-icon = 'X'.
ls_fcat-hotspot = 'X'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
ls_fcat-fieldname = 'BUTTON3'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
ls_fcat-fieldname = 'BUTTON2'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
ls_fcat-fieldname = 'BUTTON1'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
LOOP AT gt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG
*& Form SELECT_DATA
text
--> p1 text
<-- p2 text
FORM select_data .
define local data
DATA:
ls_sflight TYPE ty_s_sflight.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
ls_sflight-button1 = icon_wd_radio_button.
ls_sflight-button2 = icon_wd_radio_button_empty.
ls_sflight-button3 = icon_wd_radio_button_empty.
ls_sflight-button4 = icon_wd_radio_button_empty.
MODIFY gt_sflight FROM ls_sflight
TRANSPORTING button1 button2 button3 button4
WHERE ( carrid IS NOT INITIAL ).
ENDFORM. " SELECT_DATA
Regards,
Prasanth
Reward all helpful answers -
How can i get Radio buttons and parameters in a Single Straight Line
Hi Experts,
How can i get Radio buttons and parameters in a Single Straight Line...
Example:
r1 r2 p1 p2.....
Cheers,
Priya
Points granted.Write the following code for the selection screen:
DECLARATION OF PARAMETERS.
SELECTION-SCREEN: BEGIN OF BLOCK select WITH FRAME TITLE text-001,
BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(10) FOR FIELD p_detail.
PARAMETERS p_detail RADIOBUTTON GROUP r1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 25(10) FOR FIELD p_summry.
PARAMETERS p_summry RADIOBUTTON GROUP r1.
SELECTION-SCREEN: END OF LINE,
END OF BLOCK select.
this will solve your poblem surly. reward the points if you find helpful
Regards,
Siddarth -
How to Create a Radio Buttons using Personlization
Hi friends ,
We have requierment like , Wanted to havev two radio buttons Employee Relative : YES or NO values.
These radio buttons I wanted to add on Oracle Provided page using personlization. But the Values for the radio buttons should be YES and another button is No.
After addin it , we shall have this selected value handled in Custom Controller. How can I the radio Buttons with the above YES/No Values. Any guidelines would be greatly helpful.
Thanks Guys
Regards
RaghuHi,
Using personalization you can create radio button s, the item style as: Message Radio Button
and then extend the controller and use the below code in processrequest of the extended or custom controller:
OAMessageRadioButtonBean appleButton =
(OAMessageRadioButtonBean)webBean.findChildRecursive("GroupButtonOne"); //First Radio Button
appleButton.setName("Yes");
appleButton.setValue("Yes");
OAMessageRadioButtonBean orangeButton =
(OAMessageRadioButtonBean)webBean.findChildRecursive("GroupButtonTwo"); //Second Radio Button
orangeButton.setName("No");
orangeButton.setValue("No");
May be it will help you.
Regards
Mahesh -
How to set / reset radio buttons in screen..
hi,
i have 4 radio buttons in my screen, initially only the first one must be active and all other must not be in selected state. at any point of time only one must be selected and based on the selection the subscreen area must be filled with the subscreen.
whats the code to check if the radio button is selected or how to set the action for the radio button selection ?
also whats the statement to reset the radio button ?
thksYou put them all in a radiobutton group.
For example:
PARAMETERS: rb_pres RADIOBUTTON GROUP rbf,"Presentation Server Files
rb_app RADIOBUTTON GROUP rbf."Application Server Files
The first one is defaulted to "X", but you can also do that yourself.
You check the value = "X" to see which is selected or say IS NOT INITIAL.
Hope this helps,
Mark -
How to deselect the Radio button from htmlb.table.TableView
Hi Experts,
Could you please help me, how to seselect the Radio button from htmlb.table.TableView?
<hbj:tableView
id="tbvCustomer"
model="mcBean.csModel"
design="ALTERNATING"
headerVisible="TRUE"
footerVisible="TRUE"
navigationMode="BYPAGE"
selectionMode="SINGLESELECT"
fillUpEmptyRows="FALSE"
headerText="Searchresults"
visibleRowCount="10"
onNavigate="CustomerSearchNavigate"
visibleFirstRow="<%=mcBean.getCsVisibleFirstRow() %>">
Problem: After searching and selecting the Customer in the table, then again we are searching for another customer. After that the searched customer is displaying in the Table. By default the table Radio button is selected. Because for first Customer we have selected the Radio button. How we can deselect the FRadio button while searching for another Customer.
Thanks In Advance.
Regards,
Vijay.I think it is <2095>.
In SmartForms, go to your text window.
Use the icon on the top left of the text window to switch to the old editor.
INSERT -> CHARACTERS -> SAP ICONS.
Do a FIND on "radio". It's called ICON_WD_RADIO_BUTTON_EMPTY. -
HIdidng input field depeding on radio button selected
Hello Experts,
Can any let me know or point to a tutorial ?
how I can hide a input field another input field depending on the selected radio button.
The radio button I have are fax and email.
If Fax is selected I want to dispaly input field for fax and vice versa.
Thanks,
RajHi raj,
(1)Create two context attribute of type "Visibility".
(a) faxVisible
(b) emailVisible
(2)And bind the "visible" property of inputfields to these attributes.
(3)On radio button selection in the action handler do following thing for fax selection and vice versa.
wdContext.currentContextElement().setFaxVisible(WDVisibility.VISIBLE);
wdContext.currentContextElement().setEmailVisible(WDVisibility.NONE);
Regards,
Praveen -
How to create a radio button on OA Page using Personalization
I am trying to create a radio button on OA Page using Personalization. The item style , I can see is Message Radio Group.
How to create Message Radio Button and bring them under one group.
ThanksYou should use jdev to define a radiogroup and radio buttons under that, wrap that definition inside a stackLayout in jdev, use personalization to add a stackLayout and extend the region which you had created earlier in jdev.
-
How to uncheck all radio buttons in WHEN-NEW-FORM-INSTANCE trigger
Hi,
I have one radio group(RDBTNGRP) having three radio buttons (RDBTN1,RDBTN2,RDBTN3) in a control block, i want to uncheck all these three buttons through code.
Any help please.
Regards,Hello,
I don't think you can achieve using the code or property to unselect all radio buttons.
One possibility is there to create one extra radio button in that same group and set any value for that. Let say you have two radio buttons in the radio group and now you created one more radio button in the same group. And set the value like ABC. Now go to the property of new created radio button and set the X Position, Y Position, Width and Height to zero (0). And set the initial value for that radio group to ABC (new created radio button). So at runtime it will look like unselected all radio buttons. And while saving you can check if radio button selected on your criteria or not.
-Ammad
Maybe you are looking for
-
Looking for an external hard drive for my ibook...
I know there are a lot of posts related to external hard drives, but I have very specific needs that haven't been answered as far as I can tell. I run Tiger 10.4.11 on my 1.33 ghz ibook (which WON'T DIE) and need a hard drive that: 1) is Mac-friendly
-
How to use variable in the LIKE function along with % operators
Hi, Is there any way i can use the variable in the Like function. That means i have query like SELECT * FROM Device WHERE DeviceName LIKE %v_MediaName%; Here "v_MediaName" is the userdefined variable which contains string. I want to retrieve all the
-
How do I copy frame width & height and apply to all other frames in Indesign CS5?
I design albums using lots of photos. I often find myself copying a particular frame's width and height then pasting it individually across other frames. Is there a way to copy and paste a frames width and height and apply it across numerous frames?
-
Represent existing Storage Repository to new server pool?
I have a testing delima.. We have a block-storage SR that was in use on Server Pool A, but want to move it to Server Pool B. I dont see any way in the GUI to facilitate moving a SR (OCFS2) to a new Server pool. I know I can probably destroy, delete,
-
Hi, Trying to migrate a small Access97 database (on Windows 98) to Oracle 8.0.6 (on HP-UX 10.20) Migration Workbench 1.3.1.0.0 is installed on the Windows 98 client. Also installed is MSAccess plugin, version 1.3.1.0.0 Creation of models, target tabl