Radio button in table
Hi Experts
My Problem is i need 2 RadioButtons in a Table.so i have inserted 2 RadioButtons (Accept & Reject)in
cellEditor and i have binded those values to the boolean value which is coming from the BackEnd
.but my problem is i can select both the radiobuttons and on selecting it is showing an error
is Not A Valid value.but i need only one radio button to be selected for a row.How can i get this?
Regards,
Asif
I forgot to say that the value node must be non-singleton (singleton=false) such that it exists for every parent node element (table row).
Say you have the following context structure:
Rows (node, c=0:n, s=0:n)
-- Selection (node, c=1:1, s=1:1, singleton=false)
---- value (string)
Add two table columns "AcceptColumn" and "RejectColumn", and add two RadioButtons "AcceptButton", "RejectButton" as cell editors. Bind the "selectedKey" property of both radio buttons to attribute "Rows/Selection/@value". Further assign an action (at least a dummy action) to both buttons.
Now, to initialize the values for the table rows, write code like
for (int i = 0, n = wdContext.nodeRows().size(); i < n; i++)
IRowsElement row = wdContext.nodeRows().getRowsElementAt(i);
/* this line defines which radio button should be selected in the row at index i: */
row.currentSelectionElement().setValue("accept"); /* or "reject" */
To check the value of the radio buttons in row at index i:
IRowsElement row = wdContext.nodeRows().getRowsElementAt(i);
String value = row.currentSelectionElement().getValue();
if ("accept".equals(value))
else if ("reject".equals(value))
else
/* null or illegal value */
Armin
Similar Messages
-
Adding Radio buttons to table cell
Hi,
Im a beginner in JAVAFX, i would like to add a radio button to table cell.
Please could anybody help us on this.
Thanks,
DhanrajHi,
Im a beginner in JAVAFX, i would like to add a radio button to table cell.
Please could anybody help us on this.
Thanks,
Dhanraj -
Creating radio buttons in table coloumn.
Please share any documents available on how to
create and implement radio buttons in table coloumns .
And please also share how to read the enabled or diaabled radio buttonsHere is a guide to provide this feature:
The context:
- Persons (Node)
-- Name (Attribute)
-- SelectedKey (Attribute, String)
-- Selection (Node, cardinality: 0..1, selection: 1..1, supplyFuntion selectPerson)
--- KeyToSelect (Attribute, String)
Layout:
- Add table with dataSource propertie: Persons
- Tablerow TextView with propertie text: Persons.Name
- Tablerow RadioButton with propertie keyToSelect: Persons.Selection.KeyToSelect, selectedKey: Persons.SelectedKey, onSelect: SelectPerson
Code:
public void selectPerson(......) {
ISelectionElement el = node.createSelectionElement();
node.addElement(el);
el.setKeyToSelect(parentElement.getName());
public void onActionSelectPerson(.....) {
for (int i=0; i < wdContext.nodePersons().size(); i++) {
if (i != wdContext.nodePersons().getLeadSelection()) {
wdContext.nodePersons().getElementAt(i).setAttributeValue("SelectedKey", null);
Method above is for not getting a multiple select (work-around)
If you have a button in your layout that submits the selection, you can read the selected row with:
String key = wdContext.nodePersons().currentPersonsElement().getSelectedKey();
wdComponentAPI.getMessageManager().reportSuccess(key);
Regards,
Björn
Paresh,
Does this guide solved your problem?
Message was edited by: B. van Prooijen -
How to put a radio button ina table
Hi Frndz..
I want to show a radio button in a table which table contains multiple rows, so with this radio button user can select only one row out of multi rows.
My table like this am getting the data from RFC...
PONum BarCode OptionButton
100032 rnsnsv-e3r radiobutton
100043 sae489-q3 radiobutton
100034 fs88a7-df4 radiobutton
So with the option of radio button user can select only one row..
while using Insert Table cell editor am adding a radio button but am not able go ahead...suggest me if u have any ideas.
Thanks in Advance
Regards
RajeshHi Rajesh,
Try this:
Step1: Right click on RootUIElementContainer and manually insert the Table
Step2: Now right click on Table and Insert the TableCoulmn Group
Step3: In the TableColumnGroup Insert TableColumn
Step4: Now Insert TableCellEditor Radio Button Type.
Step5: Bind the value attributes to the Radio Button property called selectedKey and KeyToSelect and deploy the application
Thanks
Krishna -
Hi,
I need to insert a radio button in a table toolbar. Is this possible in WD ABAP.
Regards
AzadNot available in NW04s SP8.
In the view element heirarchy, right click on the Toolbar inside the table.
Then choose insert element.
The popup has only those elements supported.
Toolbar_toggle_button is the closest option.
but no radio button.
Cheers
Phil. -
Radio button in table maintainenance
HI Experts,
In table maintenance view of a table i want to see one field as radio button and want to have checked for one of the entries out of the set of entries.
My table contain four field.
Key1 key2 nonkey1 nonkey2
I want to have nonkey2 as X for only one records for all same key1.
example data set
key1 key2 nonkey1 nonkey2
E1 1 eame X
E1 2 eame2
Here user shd not be able to put second row nonkey2 as X. This i want to achieve through radio button for nonkey2 in table maintenance.
Please advise.
Regards
Shiv> example data set
>
> key1 key2 nonkey1 nonkey2
>
> E1 1 eame X
> E1 2 eame2
>
> Here user shd not be able to put second row nonkey2 as X. This i want to achieve through radio button for nonkey2 in table maintenance.
Hi Shivaram,
I could'nt get you....
If key1 and key2 are different in both cases then why can't the monkey2 be 'X'.
and the functionality you are talking about can also be easily achieved by using list box which has a value 'Blank' and 'X'.
Hope it helps you,
Regards,
Abhijit G. Borkar -
Hi,
I display a table of data. The user wants to select a row. For this, there is a column called "Select" with a radio button. The user is allowed to select only one column, but they want to do it by clicking on a radio button, not using lead selection. My problem is, that several of the radio buttons are "selected". How do I make only one radio button selectable? I want to be able to click on one radio button, and if I click on another one the first choice should be vacated.
Or if I were to use lead selection, is there an easy way to tie the radio button with the lead selection. Like, if the user selects a row, can the radio button in this row get turned on automatically?
I welcome any hints
Thanks,
IraHi Ira,
I'm not sure I understand why you would want this as lead selection should be sufficient for most selection cases. Still, one way you could use this is to embed an action hander to the OnLeadSelection event of the table. Here are my thoughts:
1. Have an attribute in the context node of type WDY_BOOLEAN or some other boolean to represent your radio button.
2. Bind the cell editor of your colum to a radio button or check box and set the value to the context attribute. You will also want to set the enabled setting to FALSE.
3. Add an action to OnLeadSelect for your table
4. Have the action handler do your button logic.
Perhaps if you give an example of the scenario for this, I'd be able to help with the solution.
Regards,
Adam -
Association of radio buttons to table rows
Hi
I am using servlets to connect to a database and display it in the form of HTML table. I need to assign a radio button to each row. This table contains around 100 rows. THe radio button should be a column before "Name". How can I assign a radio button to each row without doing 100 times like
<input type=radio name="id" value="1"> <input type=radio name="id" value="2"> ...so on for each row because I am using result set to display the table.
while(rs.next())
out.println("<TR>");
out.println("<TD>" + rs.getString("NAME") + "</TD>");
out.println("<TD>" + rs.getString("PHONE") + "</TD>");
out.println("<TD>" + rs.getString("ADDRESS") + "</TD>");
out.println("<TD>" + rs.getString("ADDRESS") + "</TD>");
out.println("</TR>");
ex table:
Name Phone Address State
asd asd dasd dasd
sada dasd dasd sadas
sda dasd sadas dasd
Any help would be greatly appreciated
ThanksYou could do it in a loop...
for (int i = 0; i < 100; i++) {
<input type=radio name="id" value="<%=i%>">
Hope this helps! -
Grouping Of radio Buttons in table Control
Hi All,
I have one problem in my table control.I am using some radio buttons in the table control.I want that in one row only one button is selected.I have grouped them.But iam not getting mutual exclusivity row wise.Infact I am getting it column wise i.e i am not able to select more than one button in one column but i can select multiple buttons in one row.
Please suggest.
Thanks In Advance,
SaketHi ,
The above mentioned is the way of creating a radio button in a table control . Can u elaborate on the issue i.e input field disabled. -
Hi ,
My requirement is to have a radio button in a table .
scenerio : i have 3 coloumns in a table as shown below
From Date To Date Select
Select coloumn is a radio button . i made that coloumn to a radio button in table not in SALV .
Now , data will be fetched from the DB for first two coloumns and where the difference of FROMDATE AND TODATE will be greater or equal to 5 only those rows should have a active radio button which can be clicked .
Other rows should have disabled radio button.
Moreover , User can select only one radio button at a time .
if it can be possible with SALV , suggest me that option as well.
Thanks.Hello,
find the steps to achieve your requirement with normal table UI element. I'm not sure whether the same will work for alv. I expect it to work
1. Create one boolean attribute in the Table Context node to indicate whether the radio button should be enabled or not (Attribute name : say RB_ENABLED). Populate the value of this attribute based on your From_Date DIF TO_DATE >= 5.
2. Create a string attribute in the table context node to indicate the value for the radio button (Attribute Name: say RB_VALUE)
Populate the Value of this attribute like for first record say FIRST and second record say SECOND. Or if you have unique Id for each row then you populate the same here.
This attribute is required to identiy which radio button is selected by the user
3. Create a context node (say RB_SELECTED) of cardinality 1..1 and an attribute of type string (say RB_SELECTED)
4. In the table ui element, create a Radio button column and bind the following
enabled property to RB_ENABLED attribute
KeyToSElect to RB_VALUE attribute
SElectedKEy to RB_SELECTED.
So at runtime whenever the user selects a radio button, the correpsonding value will be set in the RB_SELECTED attribute. example if the user selects the radio button in the first row, the value 'FIRST' will be populated in the RB_SELECTED attribute.
BR, Saravanan -
Radio Buttons on Selection Screen
Hi,
I have four radio buttons on selection screen in a frame, all belonging to the same group.
When the program is called using transaction 1, first two radio buttons are displayed. When the program is called using transaction 2, bottom two radio must be displayed.
I am doing this using the following code.
The problem is : When last two are displayed, there is empty space left on the top and first two are displayed there is empty space left in the bottom of the frame. How can this be taken care of such there are no empty spaces in the box frame?
Code:
Radio Buttons for Table Name
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-005.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : p_ot RADIOBUTTON GROUP grp1 MODIF ID one.
SELECTION-SCREEN COMMENT 5(31) text-001 FOR FIELD p_ot.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : p_exp RADIOBUTTON GROUP grp1 MODIF ID one.
SELECTION-SCREEN COMMENT 5(31) text-002 FOR FIELD p_exp.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : p_cost RADIOBUTTON GROUP grp1 MODIF ID two.
SELECTION-SCREEN COMMENT 5(31) text-003 FOR FIELD p_cost.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : p_att RADIOBUTTON GROUP grp1 MODIF ID two.
SELECTION-SCREEN COMMENT 5(31) text-004 FOR FIELD p_att.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK bl1.
Initialization
INITIALIZATION.
Display Table Names depending on transaction calling the program
PERFORM display_table_names.
FORM display_table_names.
DATA : l_mod_id(3) TYPE c.
IF sy-tcode EQ 'ZVTEST1'.
l_mod_id = 'ONE'.
ELSEIF sy-tcode EQ 'ZVTEST2'.
l_mod_id = 'TWO'.
ENDIF.
LOOP AT SCREEN.
IF screen-group1 EQ l_mod_id.
screen-invisible = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDFORM. " display_table_namesHi,
REPORT Z_SALES MESSAGE-ID ZZ .
* Variables *
DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_MSGS LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA: V_FILE TYPE STRING.
* Internal Tables *
DATA: BEGIN OF IT_SALES OCCURS 0,
AUART,
VKORG,
VTWEG,
BSTKD,
KUNNR_KUNAG,
KUNNR_KUNWE,
KETDAT,
KPRGBZ,
PRSDT,
BSTKD_1,
KUNNR_KUNAG1,
KUNNR_KUNWE1,
KETDAT_1,
KPRGBZ_1,
PRSDT_1,
ZTERM_1,
INCO1,
INCO2,
MABNR,
KWMENG,
BSTKD_2,
KUNNR_KUNAG2,
KUNNR_KUNWE2,
KETDAT_2,
KPRGBZ_2,
PRSDT_2,
ZTERM_2,
INCO1_1,
INCO2_2,
KSCHL,
KBETR,
END OF IT_SALES.
* Selection-Screen *
*Selection Screen 1
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_FILE(25) TYPE C,
O_FILE(25) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
*Selection Screen 2
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
*Selection Screen 3
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
UPDATE DEFAULT 'X' MODIF ID BL1.
SELECTION-SCREEN END OF BLOCK B3.
*Selection Screen 4
SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
PARAMETERS: SES_NAM(25) MODIF ID BL2,
KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
LOC_DATE TYPE SY-DATUM MODIF ID BL2,
USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
SELECTION-SCREEN END OF BLOCK B4.
* At Selection-Screen Output *
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
* At Selection-Screen *
AT SELECTION-SCREEN.
PERFORM VALIDATE_MANDATORY_FIELDS.
***************** INITIALIZATION ********************
INITIALIZATION.
LOC_DATE = SY-DATUM - 1.
* Start of Selection *
START-OF-SELECTION.
V_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
TABLES
DATA_TAB = IT_SALES
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form VALIDATE_MANDATORY_FIELDS
* text
FORM VALIDATE_MANDATORY_FIELDS.
IF P_FILE IS INITIAL OR O_FILE IS INITIAL.
MESSAGE E000 WITH 'ENTER BOTH THE FILE NAMES'.
ENDIF.
IF CAL_TRA = 'X'.
IF MODE IS INITIAL OR UPDATE IS INITIAL.
MESSAGE E000 WITH 'ENTER BOTH THE OPTIONS'.
ENDIF.
IF SY-SUBRC <> 0.
IF MODE <> 'A' OR MODE <> 'E' OR MODE <> 'N'
OR MODE <> 'a' OR MODE <> 'e' OR MODE <> 'n'.
MESSAGE E000 WITH 'Mode should be either A, E or N'.
ENDIF.
IF UPDATE <> 'S' OR UPDATE <> 'A'
OR UPDATE <> 's' OR UPDATE <> 'a'.
MESSAGE E000 WITH 'Mode should be either S or A'.
ENDIF.
ENDIF.
ENDIF.
IF SESSION = 'x'.
IF SES_NAM IS INITIAL
OR KEP_TRAS IS INITIAL
OR LOC_DATE IS INITIAL
OR USER IS INITIAL.
MESSAGE E000 WITH 'ENTER ALL THE FIELDS'.
ENDIF.
ENDIF.
ENDFORM. "VALIDATE_MANDATORY_FIELDS
Regards
vijay -
Suppose i have created a 2 radio buttons say A1, A2. If i click A1 radio button One table which i have created should open, Similarly when i click A2 radio button Another table should Display...an u plz give code for that??
Hi
What do you mean by table to be displayed? You mean the data from that table to be displayed in the report output.
first fetch the data of two tables into two internal tables ITAB1 and ITAB2
now write the code as
if v_r1 = 'X'. (first radiobutton is selected)
write: ITAB1 fields
else.
Write ITAB2 fields
endif.
<b>Reward points for useful Answers</b>
Regards
Anji -
How can I select a radio button in a table regarding the data in the cells?
Hi everyone
This is the issue: I need to select the RadioButton which is in a table with data related to transfers in the cells next to it, so I need to select the correct radio regarding the data next to it.
This is the whole process: First I go to the Add Recurring Transfer section and select the parameters of the transfer (Accounts, date, amount, months etc), then with VB code I capture those parameters from the page and store them into Global variables for further usage on my E-tester script.
Right after that I need to select the radiobutton regarding the data of the transfer that I already created in order to delete it or modify it (Please see Attachment selectradio1.jpg)
So How can I move along the table and compare each cell with the variables that I created with the transfer information, so when I finish comparing a row cell by cell and if all the comparison match well in that row, I could select the radiobutton of the row.
Note: Second Attachment selectradio2.jpg shows the source code of the table...If you need more info please let me know
Could you please help me with this problem?? I'm Kind of frustrated with this issue jejejeHere is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
Private Sub RSWVBAPage_afterPlay()
Dim tbl As HTMLTable
Dim tblRow As HTMLTableRow
Dim tblCell As HTMLTableCell
Dim strValue As String
Dim rButton As HTMLInputElement
' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
' Strip out the ; for inner text comparison
strValue = Replace(strValue, ";", "")
' This will get the table but can be modifoed to be more specific
Set tbl = RSWApp.om.FindElement(, "TABLE")
' This loops through all the rows in the table until a match to the strValue is found
' then clicks the radio button. Findelements allows you to specify a root element
' once the correct root row is found, FindElemets can get the correct radio button
For Each tblRow In tbl.rows
If tblRow.innerText = strValue Then
Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
rButton.click
End If
Next
End Sub
I also uploaded the script I created. You should be able to run it and see how it works.
This should get you going. -
Creating a radio button group in a column of a table in Web Dynpro
Hi,
I want to put a radio button group in a column of a table in Webdynpro. I added a column to a web dynpro view and then inserted a tableCellEditor for that column.. But I cannot define it as Radio Button group. I want the user to be able to select 3 statuses using this group.
Does anyone have a solution for this??
Thanks in advance...
NakulHi,
You wont be able create three RB in one cell.
Create as many column as the no of options is.Here it is 3.
Create 4 attributes inside the node , option 1,option 2,option 3 and selectedoption.
Map each RB s keytoSelect to option 1,2,3. Map all the RBs selectedKey atribute to selectedoption.
Now selection for each row will be stored in the selected option.
Regards
Bharathwaj -
I am trying to add 3 grouped vertical radio buttons where one is on each line of a 3 row table. When I group the 3 buttons it squeezes them into one row, is there a way I can have them grouped and one in each.
Also, I would like to know how to make part of the form highlight when one of the 3 buttons is selectedHi,
If I am not wrong, a table cell can hold only one component or none. In order to place the radio group to different positions vertically, you can use subforms instead of table.
Asiye
Maybe you are looking for
-
Can't find Adobe Creative Suite 5 Master Collection
I recently was trying to find my OLD adobe login info. I could not locate it, and therefore made a new one. Now I don't want to buy CS5 again, but I cannot locate the installer. I have the programs installed, but it will give me an error message 'Err
-
Hey, I took my sim card out of my iPhone 3GS earlier to try it in someones phone, It all came out fine without me becoming suspicious of any hardware issues. Now I'm trying to put it in it simply isn't going in at all, it looks as if the catch that i
-
Adobe reader shows text but won't print all the text
I have a form used by many and it works with no problem. Today one came in you could see all the text, but when printed, only some of the text appeared. I checked it on 3 machines, also one that has Acrobat 9 on it, same results. On the print setup
-
Eep! shut down by itself and won't turn back on.
i just tried to wake my computer, but when i pressed the space bar it turned off immediatly. now when i try to turn it on nothing happens. no lights. no noise. there is definatly power coming from the outlet and power strip. i dont know what else to
-
Hi all, I have installed Illustrator CS5 to a user and it crashes out as soon as it is launched. I have rectified this by giving the user local admin rights to the PC. This isn't a solution but a workaround. My question is: there is obviously some fi