How to sort web dynpro table wich data bind to CAF Entity Service

Hi
I created UI Table based on Model Node (CAF Entity).
When I try to sort this Table with using TableSorter, I  get following in the trace log:
The error is: com.sap.caf.rt.exception.CAFBaseRuntimeException: Aspect does not support changing rows via its list interface
Have I met CAF limitation, or do I do something wrong?

Hi Nikolai,
if you use the implementation
<code>
IServiceFacade serviceFacade = CAFServiceFactory.getServiceFacade(ts2Definition.class);
</code>
it means you use the typed access.
Possible in this sneak the
<code>
     IServiceFacade serviceFacade = CAFServiceFactory.getServiceFacade();
</code>
does not work.
Try the following way - it must work.
<code>
     private IServiceFacade getServiceFacade()  {
          final String method = "getServiceFacade()";
          entering(method);
          if (m_serviceFacade==null) {
               try {
          CoolConnectionProperties properties = new CoolConnectionProperties()
               public String getCoolHost()
                    return "caf";
                     m_serviceFacade = CoolUtils.getServiceFacade(properties);
               } catch (CoolConnectionPropertiesException e) {
                    wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
                    CAFUIPublicLogger.traceThrowable(Severity.ERROR, method, e) ;
               } catch (CoolUtilsException e) {
                    wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
                    CAFUIPublicLogger.traceThrowable(Severity.ERROR, method, e) ;
          exiting(method) ;
          return  m_serviceFacade;
</code>
Also do not sort in query. Sort the model node after you aspect binded. Use the method
node.sort(your_comparator) ;
the comparator like this:
<code>
     public class YourComparator implements Comparator
       public int compare(Object o1, Object o2)
          IWDNodeElement nodeElement1 = (IWDNodeElement) o1 ;
          IWDNodeElement nodeElement2 = (IWDNodeElement) o2 ;
          String name1 = nodeElement1.getAttributeAsText(_attrName) ;
          String name2 = nodeElement2.getAttributeAsText(_attrName) ;
          if (name1 == null)
               return -1 ;     
          if (name2 == null)
               return 1 ;     
          if (_direction == "up")
               return name1.compareToIgnoreCase(name2) ; 
          else if (_direction == "down")
               return -name1.compareToIgnoreCase(name2) ;
          return 0 ;
       public void initilize(String attrName, String direction)
          _attrName = attrName ;
          _direction = direction ;
       private String _attrName ;
       private String _direction ;
</code>
Best regards,
Aliaksei.

Similar Messages

  • Problem in data source mapping - CAF entity service.

    Hi,
    I created an external service for the bapi given below.
    It has 2 tables as input parameters.
    In entity service I created attributes(for input parameters) for table1 and table2. but in data source i couldn't map more than one attribute to the MATNRSELECTION and PLANTSELECTION.The attributes of the bapi are under the same collection.
    I'm using NWDS version 7.0.06.
    BAPI_MATERIAL_GETLIST (To List all Materials for a Particular Plant)
    Input Parameters:
    Table1: MATNRSELECTION
    MATNRSELECTION-SIGN
    MATNRSELECTION-OPTION
    MATNRSELECTION-MATNR_LOW
    Table 2: PLANTSELECTION
    PLANTSELECTION-SIGN
    PLANTSELECTION-OPTION
    PLANTSELECTION-PLANT_LOW
    Regards,
    Shobhendra

    in your entity if you did create 2 attributes for one material number and one for plant, you can map them to the corresponding MATNRSELECTION-MATNR_LOW and PLANTSELECTION-PLANT_LOW.
    For the sign and option, you should uncheck the IsNull parameter in the "Entity to External Operation parameters" mapping window of the Datasource Tab of your entity. And you should set default values like sign = I and option = EQ or something like that.
    But if you want to pass a list of material numbers or plants, I do have a recollection from last year experiments of some limitation using collections as input parameters. maybe somebody else had better success with that

  • Removing/updating data through CAF entity service

    Does anyone know a way to remove/update data through a CAF entity service from a web dynpro which uses the webdynpro model of the CAF project ?

    Hi Nicolaij,
    This example describes how UPDATE and DELETE works under SP8.
    Hopefully it helps.
    Regards
    Kamil
    UPDATE of entity called "Bank"
    =======================
    ABank recordBank;
    recordBank = BankServiceProxy.read(“000000024”);
    recordBank.setCountryId(„Germany“);
    IAspect aspectList = recordBank.getAspect();
    aspectList.sendChanges();
    DELETE from entity called "TransferID"
    ============================
    ATransferID recordTransferID;
    recordTransferID = TransferIDServiceProxy.read(„123115651“);
    IAspect aspectList = recordTransferID.getAspect();
    IAspectRow aspectRow = aspectList.getAspectRow(0);
    aspectList.removeAspectRow(aspectRow);
    aspectList.sendChanges();

  • How to use EVS with different data in each row, in a Java Web Dynpro table?

    Hi all,
    I am using EVS in a column of java web dynpro table.
    Let's say the name, and context attribute, of this column is column1.
    It's filled dynamically using an RFC, that uses as input parameter the value of another column, and related context attribute, from the same table (Let's call it column2).  Obviously, from the same row. So, in other words: the values of the EVS in column1 of row1, are dependent of the value of column2 of row1. And the values of the EVS in column1 of row2, are dependent of the value of column2 of row2. And so on... Hope i could explain myself ok.
    The code I'm using works great for filling the EVS dynamically:
    IWDAttributeInfo attrInfo = wdContext.nodeDetail().getNodeInfo().getAttribute(nodeElement.COLUMN1);
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    value.clear();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for (int i = 0; i < wdContext.nodeRFCresult().size(); i++){
              value.put(wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgort()
                 , wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgobe());
    In this code, nodeElement is the context row of the table that is passed dynamically to the method when the value of colum2 is changed.
    HOWEVER, the problem I'm having is that after executing this code, EACH NEW ROW that is added to the table has by default the same values as the first row, in the column1 EVS. And, for example, if I refresh the values of the column1 EVS in row 2, all EVS values in the other rows are also refreshed with the same values as the ones of EVS in row 2.
    How can I make sure each row EVS has its own set of independent values, so they don't mess with each other?
    Hope you guys can help me. And please, let me know if I didn't explain myself correctly!
    Thanks!

    I just did as you said (I think), but it's still having the same behaviour as before (same data for all EVS in the table).
    Here´s what I did:
    I
    In node "Detail" (cardinality 0...n, singleton set to true), which is binded to the table, I created a child node named "Column1Values" wth cardinality 1...1 and singleton set to false.
    "Column1Values" node has an attribute called "column1", of type String.
    I did the binding between attribute "column1" and the column1 inputfield celleditor in the table.
    I created an event called Column2Changed and binded it to the column2 celleditor of the table. I added a parameter called nodeElement of type IPrivateCompView.IDetailElement to this event, and mapped it to the column2 editor in the table so that I can dynamically get the nodeElement that is being affected.
    I added the following code to the onActionColumn2Changed(wdEvent, nodeElement) method that gets created in the view:
    IWDAttributeInfo attrInfo = nodeElement.nodeColumn1Values().getNodeInfo().getAttribute("column1");
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for(int i =0; i < wdContext.nodeRFCresults().size(); i++){
              value.put(wdContext.nodeRFCresults().getRFCresultsElementAt(i).getId(),
                                  wdContext.nodeRFCresults().getRFCresultsElementAt(i).getDesc());
    And with this, I still get the original problem... When the EVS of one row is updated, ALL other EVS of the table get also updated with the same values.
    What am I missing? Sorry Govardan, I bet I'm not seeing something really obvious... hopefully you can point me in the right direction.
    Thanks!

  • Display data in Web DynPro table from database via EJB

    I have a JavaBeans model which has a method populateDataToTable()to retrieve data from database via Session bean (calling entity bean, returning ArrayList of data) and the data needed to be display in the Web DynPro table.
    User Interface (Web DynPro) <-> JavaBeans Model <-> Busineess Logic (session bean) <-> Persistence (Entity Bean)<-> DB table.
    The context bindiing and table part is ok. How do i load the data to the table ? what the coding to put in wdDoInit() ?
    Any help would be appreciated.

    in wdinit(),
    Collection col = new ArrayList();
    try{                    
      MyCommandBean bean = new MyCommandBean();
      col = bean.getDataFromDbViaEJB();
      wdContext.nodeMyCommandBean().bind(col);
    } catch (Exception ex) {
       ex.printStackTrace(ex); 
    in your JavaBean model class, MyCommandBean getDatafromDbViaEJB() method:
    Collection col = new ArrayList();
    Collection newcol = new ArrayList();
    //include your own context initialization etc...
    col = local.getDataViaSessionBean(param);
    // if your returned result also a bean class, reassigned it to current MyCommandBean
    for (Iterator iterator = col.iterator(); iterator.hasNext();) {
        MyOtherBean otherBean=(MyOtherBean)iterator.next();
        MyCommmandBean bean = new MyCommandBean();
        bean.attribute1 = outBean.getAttirbute1();
        // get other attibutes
        newcol.add(bean);
    return newcol;

  • Internet Explorer limitation for Web Dynpro Table Data

    Hello everybody,
    I am having a trouble while trying to display a Web Dynpro table in Internet Explorer. This table is bound to a Context Node that is filled up manually with code, and for example if I passed more than 116 elements to the node the table only shows 116. Since this issue only happens with IE, I consider that it is related to the client part, something related with JavaScript. Any idea/suggestion?
    Many thanks in advance,
    Jesus

    Hello Siva,
    Thank you very much for your response. There is no message error, it is just not showing the entire node content, the weirdest thing is that even though WD is client independent this only happens with Internet Explorer. It works properly with any other browser such as Mozilla FF, Chrome and Safari browsers when the table has above 116 elements. When the table has below 116 elements it works properly with any browser. I have tried with IE6.0 and 7.0 using NWDS 7.0 and EP 7.0 SP 18.
    The table is child of a Group element which in turn is child of the Root Element.
    Best Regards,
    Baez

  • Load and Display Multiple Images in a Web Dynpro Table

    I am new to Web Dynpro and I am wondering if anyone can help me with an application that I am currently developing. I have a particular requirement to store images in a database table (not MIME repository) and then display them in a WD table element. An image can be of JPEG, PNG or TIFF format and is associated with an employee record.
    I want to create a view in my application that displays multiple images in a table, one image per row. I want to do this using Web Dynpro for ABAP, not Java. I have looked into pretty much all examples available for Web Dynpro and came to the conclusion that Components such as WDR_TEST_EVENTS and WDR_TEST_UI_ELEMENTS do not have any examples of images being stored in a database table and viewed in/from a Web Dynpro table element. Programs such as RSDEMO_PICTURE_CONTROL, DEMO_PICTURE_CONTROL and SAP_PICTURE_DEMO do not show this either.
    The images to be displayed in the Dynpro table are to come from a z-type table, stored in a column of data type XSTRING (RAW STRING). So I would also like to know how to upload these images into this z-type table using ABAP code (not Java).
    Your help would be greatly appreciated.
    Kenn

    Hi,
    May be this is the is the correct place to post your query.
    Web Dynpro ABAP
    Regards,
    Swarna Munukoti.
    Edited by: Swarna Munukoti on Jul 16, 2009 3:52 PM

  • Drag and Drop between Web Dynpro Tables on Cell Basis

    Hi Experts,
    I need to develop a Drag and Drop Functionality as follows:
    I have two tables. I want to drag a row of the first table and drop it in a particular cell of the second table.
    Is it possible to implement this using the Web Dynpro Drap and Drop Functionality?
    If not, does anybody have an idea of how to implement this using other concepts (Flash Integration, Building up a Grid of Images and defining those as drop tragets, etc..)??
    Valuable Advice is highly appreciated!
    THANKS, Johannes

    Thanks for the Video.. It gives some information about Drag and Drop, but still, it does not say what I need to know.
    Again:
    I need to know if there is a way to drag particular cells in a Web Dynpro Table to other locations in that same table. Plus: I need to know if there is a way to drag and drop rows of one table into particular cell of another table.
    Similar to what we do in our Outlook Calendars: We have a week in view and we see our appointments as blocks within that week view. Now, we can drag and drop these blocks to other locations. That is what I need to implement!
    Does anybody have an idea?
    THANKS, Johannes

  • Copy from clipboard and paste in Web Dynpro table

    Hi
    I have a client requirement where the client wants to copy the table from some already existing application and paste the data  directly in web dynpro java table.  It is similiar to copy the data from clipboard and paste it directly in web dynpro table.
    I would like to know is it feasible. If yes, please provide some links or guide me on achieving the same.
    Thanks
    Harsimran

    Hi
    I think one way you can do it,
      1 . try to export the table dato to excel sheet.(copy and paste to excel)
       2. Importing the excel data to WD table.
      for more details about reading excel data, there is many blog on sdn just check it.
    Hope will help you
    Thanks

  • Tree Structure in a CE Web Dynpro Table

    Hi,
    Anyone has any idea how to do it in the CE Edition?
    I've tried to follow the steps of the older versions and it didn't work:
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/bc/601c420d84db2ce10000000a1550b0/frameset.htm
    Thanks and regards,
    Eduardo

    Hi Armin,
    The tutorial asks me to: "Insert a Web Dynpro table, including the UI element TreeByNestingTableColumn (also known as the master column) in the layout of the TreeTableView."
    I didn't find this TreeByNestingTableColumn, do you have any idea what i'm doing wrong?
    Thanks and Regards,
    Eduardo

  • Using portal theme in web dynpro tables

    We are currently running EP6 (NW04).  Is there a way to make our java web dynpro table ui elements use the portal theme?  All tables appear blue unless they are checked as readonly in which case they are white. 
    I see there is a TableCellDesign ui element, but that is not available until NW04s and we are not there yet.
    Please assist. (and thank you!)
    Jeff Karls

    hi
    You are right about NW04s portal theme editor and we are able to change colour
    the tablecelleditor ui. But as far as i remember i was able to change properties like selected cell colour, non selected cell colour and mulitselected cell colour.
    However if you are not able to change it in EP 6.0 (NW04) then use the webdynpro themes. I suppose you will be able to do everything there.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d2b1d790-0201-0010-25b7-d1fb059a8ad9">How to edit webdynpro themes</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/1e/535d420447e054e10000000a155106/frameset.htm">Setting the theme in Visual admin</a>
    Hope it helps.
    regards
    LNV

  • How to call Web Dynpro from WAD

    Hello,
    How to call Web Dynpro Screens from WAD (Web Application Designer) and Vice Versa.
    Are there any parameters changes at Web item level..? Also what we have to specify at Data Provider level..?
    Your help highly appreciated.
    Thanks,
    Madhu
    Edited by: Madhu on Feb 10, 2011 1:03 PM

    Hi naveen ,
    Check these threads for calling workbook from WAD ,
    1. [SDN Help 1|/thread/268199 [original link is broken];
    2. [SDN Help 2|Insert multiple queries using either WORKBOOK, WAD or Report Designer;
    3. [SDN Help 3|http://help.sap.com/saphelp_nw04/helpdata/EN/9d/76563cc368b60fe10000000a114084/frameset.htm]
    4. [SDN Help 4|How to call a BSP page or webdynpro from a WAD Template button;
    Regards ,
    Lokesh

  • Regarding Design of background color in a Web Dynpro Table

    Hi
    I have a Web Dynpro UI Element Table having two colums and some rows. I wished to set the background color of the rows to white instead of default blue.
    Can anyone help me how to implement this?
    Regards
    Sreekar

    HI
    Shekar,
    Go thorugh the follwing Web Dynpro Java
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/business_packages/a1-8-4/nw04stack09themes.zip
    To know how to use it and for the steps to be followed please follow the tutorial here
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how to edit web dynpro themes.pdf
    the last url gives you a step by step procedure with wizards..
    I hope your problem is solved..
    don't forget to reward
    RK

  • Freeze Panes in Web Dynpro Table

    Dear all,
    How r u ?
    Is it possible to Freeze Columns (panes) in a Web Dynpro Table ?
    Kindly let me know any way this could be made possible.
    Thanks!
    Best Regards....
    Sankar Kumar
    +91 98403 47141

    Hello Harish,
    Sankar want to know, Suppose i have a table having 20+ column and i have set scrollableColCount by 10. so 10 column will be visible in starting. Now if i scroll it 1st column will hidden and 11th will be visible.so on..
    Now we want that 1st column should be visible all time. Like Freezing of first column and rest of all should move.
    BR
    Chandra

  • Making some cells bolded in web dynpro table

    Hi,
    I searched but i did not find suitable solution about bolding and coloring text in some cells in web dynpro table.
    Is it possible?
    If possible is there code sample?
    Thanks.

    hi
    check this links 
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417400)ID1938237850DB02101680362526771086End?blog=/pub/wlg/3548
    How to make last row in the table in Bold font

Maybe you are looking for