cancel
Showing results for 
Search instead for 
Did you mean: 

TableSOrter Problem

Former Member
0 Kudos

Hi ,

I have one view having two tables and two buttons(Prev Table and NextTable) in the same view . These Tables are showing the data from the same Node .

If i click on prev button , i am displaying First table in the view and same for the Next button to display second table.

Here , on both tables i want a Table SOrting .

I have written the code in the modify view (Without FirstTime), i have taken two value atrributes of TableSorter type ...TableSorter.Java file is uploaded ,Two Actions ie SortAction and Sort1Action .

Sorting is Happening Perfectly But the Problem s that i am not able to see the icon of sorting after it happens ,user will not come to know what screen has done ,but it get sorted Properly .

if(wdContext.currentContextElement().getPrevViewTableVisible() == WDVisibility.VISIBLE)

{

IWDTable table1 = (IWDTable) view.getElement("Property_First_Table");

wdContext.currentContextElement().setTableSorter(

new TableSorter(table1, wdThis.wdGetSortAction() ,null));

}

if(wdContext.currentContextElement().getNextViewTableVisible() == WDVisibility.VISIBLE)

{

IWDTable table2 = (IWDTable) view.getElement("PropertyList_Table");

wdContext.currentContextElement().setTableSorter2(

new TableSorter(table2, wdThis.wdGetSort1Action() ,null));

}

Two SOrt Actions Code is

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

{

//@@begin onActionSort(ServerEvent)

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

//@@end

}

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

{

//@@begin onActionSort1(ServerEvent)

wdContext.currentContextElement().getTableSorter2().sort(wdEvent, wdContext.nodeProp_List());

//@@end

}

Would Anyone tell whats going wrong ?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It seems there are not rewards for sharing code and explanations in questions. I just want to let you know that detail of your explanation of this problem helped me solve my sorting table problem.. <b>THANKS!!</b>

BTY how did you solve the icon problem?

Former Member
0 Kudos

My experience is that it is VERY important that the node which contains the data which should be sorted is a VALUENODE and not a MODELNODE!

I can't imagine that it has something to do with this, but...

Former Member
0 Kudos

Hi,

Try opening the table sorter code and see which path the image location is pointed to.

Regards

Bharathwaj

Former Member
0 Kudos

Code from actual sort method (From TableSorter.java File is ). Would you please tell what changes needs to be done for this .still not getting those sorting icons

// set icon in currently sorted column

if ( currentlySortedColumn.getHeader() != null )

currentlySortedColumn.getHeader().setImageSource(reversable.isReversed()

? "~sapicons/s_b_srtd.GIF"

: "~sapicons/s_b_srtu.GIF");