on 03-11-2008 3:56 AM
Hi,
Iam working on customization of a table in Webdynrpo Java.This is not the column swapping functionality. Its a positioning of the column.The column names are to displayed along with the position of the columns. When I select a particular position for a column, the column should appear in that position.For example:-
In my table, the column XXX is positioned at 5th and I want to change the position of the column XXX in the same table to 2nd position(not swaping,its positioning)
Can anyone guide me how to do this?
Hope i made my requirement clear.
Regards,
Padmalatha.K
Points will be rewarded.
Hi Ayyaparaj,
IWDTable table;
table.removeGroupedColumn(index);
table.getGroupedColumn(index);
table.addGroupedColumn(groupedColumn, index)
-
Im not getting the method called "removeGroupedColumn" in my NWDS.I m using NWDS 2.0.
Do i need to import anything tio get this method.
I am able to remove column from the Table.But I m not able to add it in the proper position in the table.
I am removing the column like this:-
table.removeColumn(34);
And I am trying to add the same column in perticular position like this:-
table.addColumn(column, index);
I m struck in here.
Please suggest how to pass the parameter
In the above code in Line 4,Can you please specify what is the first parameter "groupedColumn" ?And how do u pass the parameter.
Can you please send some more code on this?
Regards,
Padmalatha.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Than Q Ayyaparaj,
The issue is resolved.Thanks a lot again.Full marks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ayyaparaj,
The approach which you have mentioned is correct,
But I have around 50 column in my table.Removing all the columns and adding them all according to positions is not possible.
Is there any other way that we can work on?
Means is ther any sap inbuilt method to position the columns in the table.
Regards,
Padmalatha.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ayyaparaj,
This is my requirement:
I have an application which has a table. This table contains 5 columns say A,B,C,D,E in the same order.
Below the table, i have a customize button.This button is used to customize the table.
When i click on this button a window should open up which will have the column names listed along with a dropdown .
The dropdown will have 1,2,3,4,5 as the values. When i select 3 from the dropdown(For positioning) for the column A ,then the column A should be shifted to 3rd position.
Please help me how to proceed for this.
Please give your mail id so that i can explain my requirement properly.
Regards,
Padmalatha.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Following is one of the approach
Hope you have the corresponding context attributes which stores the values of the dropdown
create a context attribute of type boolean lets say "RearrangeCols" initially set this to false
when the customize button is pressed or else if you have an apply(OK) button as part of the window. assing the context attribute "RearrangeCols" to true.
in wdDomodify check if this attribute is true.
Then remove all grouped colums and start adding them based on the condition specified by the user.
Ex:
boolean columnAlignChangeNeeded = wdContext.currentContextElement().getRearrangeCols();
if(columnAlignChangeNeeded)
{
IWDTable table = (IWDTable)view.getElement("Your Table");
table.removeAllGroupedColumns();
//Add your colums based on user selection
// get the columns
table.addGroupedColumn(groupedColumn);
}
regards
Ayyapparaj
Hi Ashok,
Table is already created dynamicaly and i have a personalize button in this table.In this customize button to customize the table. I have to put the functionality like this:-
I have a table (static/Dynamic)with 5 columns say in the order A,B,C,D,E.
In the functionality button, I have to change the position to B,A,D,C,E
.After that when I click OK button,the changes should be reflected in the table(Static/Dynamic) in the order B,A,D,C,E.
This is not swapping.This is positining the column in the table.
Please suggest me how to do this.......
Regards,
Padmalatha.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If i am in track with your requirement
What comes to my mind right now is you can have a check in the wdDomodify and realing the cols based on a condition.
Ex:
if(columnAlignChangeNeeded)
{
IWDTable table = (IWDTable)view.getElement("Your Table");
table.removeAllGroupedColumns();
//Add your colums based on user selection
table.addGroupedColumn(groupedColumn);
}
Regards
Ayyapparaj
Hi PadmaLatha,
From what I have understood ,you want to position a column dynamically based on where the user wants to see the column.You may capture this position as an input from user.
You should be able to do this by data binding dynamically on the table.The logic should offcourse be behind it it depending on user input/selection.
Many Thanks,
Ashok
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Suppose you have one table called "TABLE" and you have 5 columns, A, B,C,D,E in this order and you want to set the position as A,B,E,C,D. To do this , in the OUTLINE of the view layout, right click on Table column E and select "MOVE UP" . It moves above D, then Apply the same methos again to get the desired location. Follow the method, to get the desired position of your table columns, Any further queries, Please write back...
Award points in helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
.
Edited by: Vinod V on Mar 11, 2008 1:11 PM
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.