on 05-16-2007 3:12 AM
as title as said.how to rearrange the table column order by some event.
any clues will be appreciate!
Hi
Take a boolean Attr in context,set the value true in the Action where you want to swap the columns.
In wdModifyMethod get the value of that attr using wdContext object ref.
Swap the table columns
Again set the Attr value to false.
This is the one way of acheiving that
regards
kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<a href="https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/uielib/standard/api/IWDTable.html#swapGroupedColumns(int, int)">IWDTable.swapGroupedColumns(int, int)</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sir.in fact i can do it as u said in
wdDoModifyView(..){
if(firstTime){
IWDTable tbl = (IWDTable) view.getElement("TableTest");
tbl.swapGroupedColumns(1,2);
}
}
but now i wanna rearrange them by some other event(not in wdDoModifyView method).i cann't got the<b> view Object</b>.how to got it...
IWDTable tbl = (IWDTable) view.getElement("TableTest");
Hi,
In the other event method did you tried refreshing the view. I think then the wdDoModifyView(...) will be called. Then you swap as you are doing in above code snippet.
Also you can fire inbound plug to the same view. In that case also the view will be refreshed and WdDoModifyView(...) should be called.
Regards,
Ashwani Kr Sharma
sir,
i have another confusing for another.
e.g: i have five columns(A,B,C,D,E in order) in one table.i wanna put the first column(A) to the last position(order by B,C,D,E,A ),as u said,i must do four steps as following?
A->B -
>
tbl.swapGroupedColumns(0,1);
B->C,----
>
tbl.swapGroupedColumns(1,2);
C->D,----
>
tbl.swapGroupedColumns(2,3);
D->E -
>
tbl.swapGroupedColumns(3,4);
i have any else ways to realized it once?
Wing,
Try the following (should work):
IWDTableColumn col = table.removeColumn(0);
table.addColumn(col);
Valery Silaev
SaM Solutions
Hi,
Let's say your column order is initially [A,B,C,D]. If you want to rearrange it to [B,C,D,A], you can use (as suggested by Valery)
IWDTableColumn col = table.removeColumn(0);
table.addColumn(col);
Now if you have to go back to the original column settings, then you can use
IWDTableColumn col = table.removeColumn(3);
table.addColumn(col,0);
Regards,
Satyajit.
sorry for my unclearly expression!
i just made a simpliest example as aboving.
in fact we should often have such requirement as following:
many columns in a table control needing to be rearrange,
there are two arrangements(the <b>two</b> and the <b>three</b> status as following said) after rearranged.
So it involved three status:
-
one: the original arrangement.
<b>two</b>: rearranged from one status
<b>three</b> : <b>(i)</b> rearranged from one status ;
(ii) rearranged from two status ;***********(<i>at here i hope i can got the original arrangement status.that i can invoke the same function as item <b>(i)</b> do.</i>)
Hi ,
I would suggest you to get the IDs of all columns and store it in an arraylist.
If the order needs to be changed, change the order of IDs in the arraylist.
While adding the columns to the table, read the value from the arraylist
//loop through array with index "indx"
table.addColumn(arraylist.get(indx))
By using an arraylist for storing order and reading the values from the arraylist.. you can re-arrange by pushing the values in the arraylist in that particular order .
Does it suit your requirement ?
regards
Bharathwaj
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.