cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro Table: Column Header sort icon not visible

Former Member
0 Kudos

In design time in NWDS, my table headers have this up/down arrow icon that is visible to indicate sorting.

At runtime it is not displayed. How come?

Accepted Solutions (1)

Accepted Solutions (1)

snehal_kendre
Active Contributor
0 Kudos

HI KF,

You want the icon should be on table header at intial screen call. This sort icon will appear only when you perform sort action. and if you want to make that icon visible befor applying sorting then do one thing.

wdContext.currentContextElement().getContextOf Table().getColumn(no of col where you want icon).getHeader().setImageSource("~sapicons/s_b_srtu.GIF"//or any icon as your wish);

using this method you can apply any icon to your table header..

Answers (5)

Answers (5)

former_member751941
Active Contributor
0 Kudos

Hi KF,

According to the Node Structure

Employee

|----


name

|----


no

|----


sal

public static void wdDoModifyView(IPrivateEmployeeView wdThis, IPrivateEmployeeView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

if (firstTime) {

IWDTable sortTable = (IWDTable) view.getElement("Put the table id here");

<b>

wdContext.currentContextElement().setEmployeeTableSorter(new TableSorter(sortTable, wdThis.wdGetSortEmployeeAction(), null,

new String[]{"name","no","sal"})); </b>

//Instead of column id passes the attribute name of the node that is bound with the table.

}

}

//EmployeeTableSorter is the context attribute of type …….utils.TableSorter

public void onActionSortEmployee(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionSortFundID(ServerEvent)

wdContext.currentContextElement().getEmployeeTableSorter().sort(wdEvent, wdContext.nodeEmployee());

//@@end

}

Regards,

Mithu

Former Member
0 Kudos

Very strange....I have implemented sorting and filtering on my table and it works. However the little sort icon does not appear in the upper left corner of the first column and the up/down arrows do not appear to the right of my column headings.

After I perform a sort, the icon appears. After I perform a filter the icon appears.

However on the initial screen the user will not know that there is sorting functionality because the arrows dont appear, neither will they know that filter exists cause the icon does not appear.

Former Member
0 Kudos

May be, try sorting in the init (or whenever you display the table) before rendering the UI and see whether that helps.

Thanks.

MSR

Former Member
0 Kudos

KF

I too have this problem.How did you fix this.

Reg,

Ashok

Former Member
0 Kudos

My table columns only have the Event called "onAction" (There is no event called "onSort"), however I created an action call onClickColumn and bound it to the "onAction" and still I do not see the arrow icons.

Former Member
0 Kudos

Please look at the following article, it should help you. I guess you haven't implemented the necessary code for sorting. Sorting is not automatically available in WD atleast with older packages.

/people/kapil.kamble/blog/2006/12/21/how-to-get-ready-made-filter-for-your-web-dynpro-table-with-minimal-coding

Thanks.

MSR

Former Member
0 Kudos

Hi

Let me know how you created the table by giving apply template.

Check whether you created sortting action.

Regards

Chandran S

Former Member
0 Kudos

Hi,

Every table has a attribute called onSort.So,you have to create a action Sort and bind it to the onSort attribute of the table.Then only the icons will be visible at runtime.

Regards,

Sudhir