cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting the content of table at first showing of the table

0 Kudos

Hi WD Experts,

I can't find the solution of this very important case

Suppose this very simple scenario:

I have master-detail relation between two tables

and I try to show the content of detail table in some order (ascending order of first column)

Also in UI I want to see the sorting icon

I do this with generating of CustomEvent in OnLeadSelect

HashMap map = new HashMap();

map.put("col", "Version");

IWDCustomEvent wdEvent = new CustomEvent("onActionSort", map, true);

wdThis.onActionSort(wdEvent);

but unfortunately my detail table is ordered alternately

(asc and desc order)

In WD tutorials I find the tutorial for sorting the table

but sorting is triggered by user action - I want sorting to be executed programmatically and to be executed always in asc order

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rosen,

i suggest to use a supply-function for this. Create a corresponding supply-function method for the context node, which is the data source of the table. The method will be called immediately when the context node data is needed and can be manually triggered by invalidating the node later. Create/sort the node elements there and bind (or add) them to the node in the order desired.

Hope that helps.

Regards

Stefan

0 Kudos

Hi Stefan,

I am using a supply function - and sorting there is workaround - but the user can not see the sorting icon on the proper column - the first appear of icon is when user click on the column header for first time.

I want user to see which column is sorted initially

Message was edited by: Rosen Chaushev

Former Member
0 Kudos

I suppose you store the current sort direction in some context attribute. If you define a second (calculated) attribute of type String, that will always contain the icon file name for the current sort direction, and you bind the icon in the table column header to this attribute, what happens?

Armin

0 Kudos

Hi Armin

I would rather prefer to use internal WD mechanism instead of using the context for storing the sorting icon

(WD automatically put the sorting icon in column header when user click on table header)

and more in depth - I want to create a CustomEvent - but in event I want to pass the sorting direction

Former Member
0 Kudos

In NW04 there is no such mechanism, the application itself has to provide the sorting direction icons.

Armin

0 Kudos

There is such mechanism

Look at "Developing with Tables in Web Dynpro.pdf"

in tutorials

in Sorting the Shopping Basket Using the Price

Rosen

Message was edited by: Rosen Chaushev

Former Member
0 Kudos

I don't know such a mechanism.