cancel
Showing results for 
Search instead for 
Did you mean: 

Table Sorter Plugin

Former Member
0 Kudos

hi,

I am unable to find the plugin "com.sap.tc.webdynpro.tests.utils.TableSorter" in the available plugins.

What can be done about that??

Please help

Thanks,

Sirisha Matta.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Check this blog

/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s

Regards

Ayyapparaj

Answers (1)

Answers (1)

Former Member
0 Kudos

HI

You will get TableSorter.java file..just download it

Regards

Chaitanya.A

Former Member
0 Kudos

where can I find that file?

Former Member
0 Kudos

Hi

At the end of this blog their is a link to download

/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s

Pl read the blog

Regards

Ayyapparaj

Former Member
0 Kudos

Could you give me the procedure for the same please.

Former Member
0 Kudos

Hi,

I am not confident, but this may be correct( Please somebody can correct if I am wrong). Steps are as follows:

1) Create context variable of type TableSort( I ahve doubt here)

2) table properties:<b>sort property</b> assocaite sort method ---> create a method sort with code as follows

wdContext.currentContextElement().getTableSorter().sort(
		wdEvent,
		wdContext.nodeEtb_Cbrgem_Dta());

Regards,

ganga.

Former Member
0 Kudos

Hi,

from the blog

Add the TableSorter class TableSorter.java to the new package folder src/packages/com/sap/tc/webdynpro/tests/utils

Declare a new context attribute TableSorter of type com.sap.tc.webdynpro.tests.utils.TableSorter within the view controller context.

Declare a new action with name Sort (or SortCustomers in this example) and with the associated action event handler onActionSort() to the view controller.

Implement the following source code in the wdDoModifyView()-hook-method of the view controller:

public static void wdDoModifyView(

IPrivateWork wdThis, IPrivateWork.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

if (firstTime) {

IWDTable table = (IWDTable) view.getElement("CustomerTable");

wdContext.currentContextElement().setCustomerTableSorter(

new TableSorter(table, wdThis.wdGetSortCustomersAction(), null, new String[] { "CustomerTable_Name" }));

}

//@@end

}

In case you apply the new generic UI service which automatically creates all custom extension fields (only supported for Adaptive RFC models) in the view layout you must additionally invoke the IWDView interface. By default, custom extension fields are created automatically after the first call to wdDoModifyView() that follows the creation of a parent element (e.g. table) that aggregates custom extension fields. Of course, this only relates to custom extension fields that have been explicitly configured by an administrator for the current user role. In case you want to modify these custom extension fields (e.g. making table columns sortable) you must call the method IWDView.nowCreateAllCustomExtensionFields() before:

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

{

//@@begin wdDoModifyView

if (firstTime) {

view.nowCreateAllCustomExtensionFields();

IWDTable table = (IWDTable) view.getElement("CustomerTable");

wdContext.currentContextElement().setCustomerTableSorter(

new TableSorter(table, wdThis.wdGetSortCustomersAction(), null, new String[] { "CustomerTable_Name" }));

}

//@@end

}

Organize imports within the view controller class so that import com.sap.tc.webdynpro.tests.utils.TableSorter; is added.

Implement the following source code in the action event handler onActionSort() (or onActionSortCustomers in this example).

//@@begin javadoc:onActionSortCustomers(ServerEvent)

/** Declared validating event handler. */

//@@end

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

{

//@@begin onActionSortCustomers(ServerEvent)

wdContext.currentContextElement().getCustomerTableSorter().sort(wdEvent, wdContext.nodeCustomers());

//@@end

}

Regards

Ayyapparaj

Former Member
0 Kudos

I am unable to see this "src/packages/com/sap/tc/webdynpro/tests/utils"

under the src/packages for a given dynpro?

Do i have to manually put it in there

Former Member
0 Kudos

Yes you have to create a package of yours or else place in an existing package

use the navigator view to find and create packages