Skip to Content
avatar image
Former Member

How To Refresh Data on View

Hi All,

<b>How to Refresh my Data on My View?.</b>

In my application, i get data to table from BAPI. Once i click one record on table, it takes to another view(Here i display full information of table content). If user update his data, it will update particular record in my DB. UpTo Here is fine.

If the user wants to change another record, he will go back and pieck another record. Here table data is not refershing. I read about view.reset(). and i also tried to invalidate() method in WdExit(). Even then it s not refershing. Can any one help me?.

Another Quation: <b>How to sort data on Table?</b>

Can any one proved sample code?

Thanks & Regards

Ravi Golla

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    May 14, 2007 at 02:10 PM

    Hi Ravi,

    Please refer to this ,It will solve the tabe sorting problem for you.

    public void sort(String columnId, IWDNode dataSource) {
    		IWDTableColumn column =
    			(IWDTableColumn) table.getView().getElement(columnId);
    		ReversableComparator reversable =
    			(ReversableComparator) comparatorForColumn.get(column);
    		if (reversable == null)
    			return; // not a sortable column
     
    		// remove icon of previously sorted column
    		if (currentlySortedColumn != null
    			&& currentlySortedColumn.getHeader() != null)
    			currentlySortedColumn.getHeader().setImageSource(null);
     
    		// bookkeeping
    		if (column == currentlySortedColumn) {
    			//			reversable.toggleReversed();
    		}
     
    		currentlySortedColumn = column;
     
    		// 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");
     
    		// sorting
    		dataSource.sortElements(reversable);
    	}
    

    Regards,

    Ashwani Kr Sharma

    Message was edited by:

    Ashwani Kr Sharma

    Add comment
    10|10000 characters needed characters exceeded

    • import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTableColumn.

      You can press CtlrShift'O' after copy pasting the code attached earlier.

      Your imports will be resolved automatically.

      Regards,

      Ashwani Kr Sharma

      Message was edited by:

      Ashwani Kr Sharma

  • May 14, 2007 at 02:12 PM

    Some more helpful threads !

    table-sort-issue

    sort-a-table

    sort-table-in-wd

    Regards,

    Ashwani Kr Sharma

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 14, 2007 at 02:05 PM

    Hi,

    Call the method to get data from BAPI onplugfromscreen2

    AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 14, 2007 at 02:08 PM

    Hi,

    You get a lot of threds and blogs if you serach for Tablesort

    But its always better to open different threads for different questions

    AM

    Add comment
    10|10000 characters needed characters exceeded