on 06-22-2007 10:22 AM
Hi all,
Could Any one help me out in working with Radio buttons and Check boxes by sending any useful material.
1)Currently my requirement is if I click on a radio button in the table, corresponding row have to go as input to other bapi.
2) If I check the check boxes (one or more) in the table, only corresponding row( which are checked) should be captured and displayed in the next screen.
regards
Deepu
hi,
1)create 1 attribute as select,bind this attribute to checkbox
2)insert checkbox in table
3)click checkbox->properties>onToggle->create action and write the code
Declare flag as global variable,
static int flag;
{
flag=wdContext.nodeViewFlightTest().getLeadSelection();
}
4)In table properties there is an option,onLeadSelection---->create action
it is used to select only 1 check box, defaultly first record is in lead selection, u want to select some other record...u have uncheck first checkbox....for that we using this code....
if(wdContext.nodeViewFlightTest().getViewFlightTestElementAt(flag).getSelect())
{
wdContext.nodeViewFlightTest().getViewFlightTestElementAt(flag).setSelect(false);
}
5)context map ur first view Bapi node to component controller then context map second view to component controller....
6)using apply template in second view,u can display whatever data u want....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go through the thread for you solution for radibutton
One more for more insight
getting the values of the selected row when a user clicks a radiobutton is as good as getting the leadselection of the table.
In the action of radiobutton
int i = wdContext.nodeTable.getLeadSelection(); // get the row selected.
wdContext.nodeTable.getTableElementAt(i).get<tableColumnName>(); // get the elements of the selected row.
Store this value or set it directly to the Bapi input attributes and then call the execute method of the BAPI.
Message was edited by:
Shriram Kabra
If I check the check boxes (one or more) in the table, only corresponding row( which are checked) should be captured and displayed in the next screen.
View which had table with checkbox "MainView"
View where checkbox selected row to be displayed "DisplayView"
Cardinality of the tablenode in both the view is 0..n with selection mode 0..1
Also see that the DisplayView node for table is avialble in the Main view through
proper context mapping.
Assuming your Table node is like this in both the views
Context
--Table (node)
-
Name (attribute)
-
UserID (arribute)
Inside the Main view
1. Create a column under the table.
2. Right click on the columns and select Insert TableCellEditor and choose CheckBox
3. Create a value attribute "Checked" of type boolean under the table node.
4. In your action to navigate to other view
// fire a outbound plug to the next screen
5. In the inBound lug method of the DisplayView
for(int i=0;i<wdContext.node<MainViewTableNode>().size();i++)
{
if(wdContext.node<MainViewTableNode>().get<MainViewTableNode>ElementAt(i).getChecked())
{
// create element in the node of Display View
IPrivateDisplayView.I<DisplayViewNode>Element elem = wdContext.node<DsiplayView>().createCElement();
wdContext.node<DsiplayView>().addElement(elem);
// add the selected row values to the node of DisplayView elem.setName(wdContext.nodeMainViewTableNode().getMainViewTableNodeElementAt(i).getName());
elem.setUserID(wdContext.nodeMainViewTableNode().getMainViewTableNodeElementAt(i).getUserID());
}
}
HI,
1) When I am selecting one check box, all other checkboxes (including selected one) are activating (selecting automatically), when I uncheck one check box all others are disabled (including selected one). what I need to do.
2) And you said that to write the code in inBound plug. I am writing it in ontoggle method. and by default fist row is going to next screen.
Please help me out in this regard.......
(I need to select multiple checkboxes in the table)
pradeep_bondla@satyam.com
and also I have followin problems
I am using check box in my table. and writing the code in "ontoggle" method of the check box.
1) when I am selecting a checkbox in the 3 rd row of the table, in the next screen (where it should display in the first row ) its leaving first 2 rows empty and showing in the 3 rd row. same if i select 5 th row, its showing all 4 rows empty and showing in the 5th row. How to show rows from 1st row.... ( I am selecting multiple rows)
2) when I am selecting one row, after navigating to next screen if I go back and select another row, first displayed row is not refreshing. old values exist in the displayed table. how to refresh it.
3)If I select a check box and unselect it immediatly, still that row is displaying in the next screen. what to do if I want NOT to display if a check box selected and unselected without proceeding to next screen...
4) in the second screen when i click back button, I could see the selected check boxes checked only, what to do to refresh the page when I come back and go front
Hi Pradep,
I think you will be using 'lead selection' to display the records in next screen, then only one row, which is been lead selected will be displayed in second screen. Use the check box '
state
' for displaying the selected records in next screen.(i.e) Display the records whose checkbox state is '
true
'.
Regards,
Prabhakar.
yes u r right..... Now I almost got it.... just one problem...
in main screen after the records one empty checkbox with row and in the display view first row with empty fields and check box comming. actually in the display view the records should be displayed in from 1st row of the table but its populating from 2nd row.... what would be the problem???
Hi Pradeep,
In the 'Layout', to the Table UIElement, add a column and insert a Table Cell Editor of type Radio Button. Now, in the 'Context', within the node bound to the table, insert a value attribute key_to_sel of type string. Also create a value attribute sel_key of type boolean directly under the root node (context itself). Now, map the keyToSelect property of the radiobutton to ' key_to_sel ' and selectedKey property to ' sel_key '. This will see to it that you are able to select only one radiobutton at a time.
Kindly revert back for more details.
Regards,
Leena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi pradeep,
check this link,
regards,
vino
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pradeep,
1)Currently my requirement is if I click on a radio button in the table, corresponding row have to go as input to other bapi.
There is an event in the radio button which gets called every time the radiobutton is selected and vice-versa you have to get the lead selected element of the table node and add it to the BAPI from there.
2) If I check the check boxes (one or more) in the table, only corresponding row( which are checked) should be captured and displayed in the next screen.
Again the event for check box is onToggle which will and similarly get the leadselected element in the table node and buffer it some other node use WDValueServices for copying it to the exact same node structure as that of the table datasource and then you can display it once you map this node to another view.
Regards
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai pradeep,
for Radiobuttons,
context look like
-node
-somevalue
-somevalue
-somevalue
-keytoSelect
-selected key.
bind this node to your table, just bind the keyselect and selcted key to your radiobutton.
evry radio button in a row is having a unique keytoselectvalue, If you select any of the radiobutton, the keytoselect value is to be the selcted key like this,
mostly you can use id of the row be the keytoselect for radio button.
Regards,
Naga
You will have to set the property selectedkey to false in that case.
Code sample for sample code to get the values of corresponding table row for which radio button is selected:
when it goes to the selectEvent create a boolean attribute and set a condition to access the wdDoModifyView()
IWDTable table = (IWDTable)view.getElement("tableName");
IPrivateView1.INode1Node node1 = wdContext.nodeNode1();
for(int i=0;i<node1.size();i++){
boolean b = node1.getNode1ElementAt(i).getSelectedKey();
// pass this node element to the BAPI by
//for the property value true.
}
Regards
Amit
Message was edited by:
Amit Kesari
In the doInit() of the table view I made the radio button false, but still it i am seeing all radio buttons are selected. I am not able to select only one radio button.
I wrote
wdcontext.currentContextElement.setVaRadioButton(false);
in doInit() of the table view.
what I need to do??
2) which node i need to pass?? like
if(b)
{
// then get the single row?? (how??)
}
please help me out
Hi Pradeep..
see thse links..
This is the link with example for checkbox group and radio button..
http://help.sap.com/saphelp_erp2005/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/content.htm
This thread contains the details abt radio button and check box. It might be useful
for you.
URs GS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.