on 12-06-2007 6:15 AM
Hi all,
i am having a tabel with some data which is fetched from R/3 system.Now i have to delete some records selected by the user form R/3 system means user may select multiple rows also..
How is it possible for a Table component in webDynpro..At a time only one row is getting selected but if i hold (keyboard key)control and click on others rows then only multiple rows are getting selected.
Is there any alternate way that user can select multiple rows directly with mouse itelf
Regards
Padma N
HI,
try this code,
for(int i=wdContext.node<Node>().size()-1;i>=0;i--)
{
if(wdContext.node<Node>().isMultiSelected(i) || wdContext.node<Node>().getLeadSelection()==i)
{
// Perform delete operation for row i
}
}
Otherwise you can use checkbox in table for this.
Regards
LakshmiNarayana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi LakshmiNarayana ,
wat it mean if(wdContext.node<Node>().isMultiSelected(i) actually and
how to keep checkboxes in my table..should that checkboxes be a sepeare column....
i am having a table with 5 fileds which are already mapped with R/3 model...
it is not giving permission to update the tabel with one more column for checkboxes
Regards
Padma N
Hi padma,
Write the code inside action of delete button.
1> For Check box.
isChecked(boolean) value atttribute under ValueTableNode that is bound to the table.
int n = wdContext.node<ValueTableNode>().size()
for (int i = n - 1; i >= 0; --i)
{
if(wdContext.nodeValueTableNode().getValueTableNodesElementAt(i).getIsChecked())
{
//write the code for delete record using RFC .
wdContext.nodeValueTableNode().removeElement(wdContext.nodeValueTableNode().getElementAt(i));
}
}
2> If you are not using check box then
int n = wdContext.node<ValueTableNode>().size();
int leadSelected = wdContext.node<ValueTableNode>().getLeadSelection();
for (int i = n - 1; i >= 0; --i) {
if (wdContext.node<ValueTableNode>().isMultiSelected(i) || leadSelected == i) {
//write the code for delete record using RFC .
wdContext.nodeValueTableNode().removeElement(wdContext.nodeValueTableNode().getElementAt(i));
}
}
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f699f90-0201-0010-14a4-8950177281ed">Developing with Tables in Web Dynpro</a>
Regards,
Mithu
Hi,
In the given code only user can delete one record at a time not multiple..If user wants to delete multiple records with mouse selection with out using Cntrl key its not possible i think
2> If you are not using check box then
int n = wdContext.node<ValueTableNode>().size();
int leadSelected = wdContext.node<ValueTableNode>().getLeadSelection();
for (int i = n - 1; i >= 0; --i) {
if (wdContext.node<ValueTableNode>().isMultiSelected(i) || leadSelected == i) {
//write the code for delete record using RFC .
wdContext.nodeValueTableNode().removeElement(wdContext.nodeValueTableNode().getElementAt(i));
}
}
Regards
Chandrashekar.
Hi Padma,
Also try this:
Set the table property "compatabilityMode" with value 'nw04Plus'.
Make sure that the cardinality of the node element is set to 0..n
And make sure that you have added atleast one row to that context node(which is binded to the table) before you want to edit any field.
I am able to achieve this in my application. If you still have some problem just give me more details about your application.
Regards,
Kiran Chennapai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think...few users may complain about selecting multiple rows by holding ctrl key.
So they will ask us to provide the functionality like just one click on each row without holding the ctrl key.
In such situations we have to use one extra column(check boxes) as the first column in the table.
And we can remove the standard selection column by setting that parameter selectionMode as "none".
In your logic when ever you want refer to perticular row..just refer to the field which has that check box field as "ticked".
I hope this will resolve your problem and make user feel comfortable with the table operations.
Regards,
Kiran Chennapai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
In my Context i created a valueNode as ChkNode and ValueAttribute as ChkVal and i added one column to my table and i binded ValueAttribute to Chkbox.
and i kept the selectionMode property to NONE .
but the problem is the Chkbox colum of table is not in editable state..so that user is not able to select any checkbox.
How to make the column of the table which has checkbox to editable so that user can select multiple rows with mouse rather than control Key.
Regards
Padma N
Hi Ayyapparaj ,
My checkboxes column is not comming in editable state.
I created a ValueNode with cardinality 1..1 and selelctioNode is 0..1
the ValueAttribute is of type boolean .
i mapped Texts Property of checkbox to that valueNode
Wat abt Checked Property of the CheckBox Column.
Wat to do to make that column editable so that user can select multiple rows at runtime
Regards
Padma N
Hi,
You can create a separate value node with all the fields as in your existing node(dont use structure binding, just copy only the fields)and add another column for check box(boolean type).
Remeber to set the table control parameter selectionMode to "none" to increase the table control performance.
And apply the logic as it required.
Regards,
Kiran Chennapai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.