Skip to Content
avatar image
Former Member

"Enhancing Web Dynpro Table Performance" tutorial

Hello,

we try to set up the "Enhancing Web Dynpro Table Performance" tutorial. After importing the project into the developer studio (SP13) we get import errors for the TableCompatibilityModeView:

Error by

import com.sap.tut.wd.tutwd_table.tablecomp.wdp.IPrivateTableCompDetailView;

import com.sap.tut.wd.tutwd_table.tablecomp.wdp.IMessageTableComp;

import com.sap.tut.wd.tutwd_table.tablecomp.wdp.IPrivateTableCompatibilityModeView;

zip file downloaded from:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on creating tables in web dynpro - 11_0_.htm (Part B)

Has anyone experienced similar problems? Any solutions?

Greetings

Peter

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Nov 29, 2005 at 09:43 AM

    Hi,

    Try using organize Imports("CTRLSHIFTO") or repair and rebuild the project.

    Regards, Anilkumar

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 29, 2005 at 09:50 AM

    Hello Peter,

    Try to reload+rebuild the project. Everything under wdp folder is generated.

    Best regards, Maksim Rashchynski.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 29, 2005 at 12:11 PM

    I have tried to repair, reload and rebuild the project, but it didn't help.

    I have imported this example in a fresh and new SP13 Dev.Studio installation but the same problem appeared.

    Step 8 in the tutorial (In the node’s context menu, choose Deploy new Archive and Run. The sample application is

    then started in a new browser window.) is possible but gives a warning "The project XXX has generation or build errors. The requested archive build will most likely fail...."

    After clicking OK even more errors are listed 😔

    Peter

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 29, 2005 at 12:18 PM

    Which errors appear in the "Tasks" view of Eclipse?

    Armin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      After import there is also an error about build path but after refreshing the project there are just this two:

      ContextValueAttribute TableCompatibilityMode [type]: Type missing (Hint: The type property must be set to a simple type, a built in type or any java native type) TableCompatibilityModeView.wdcontroller TutWD_Table_CompatibilityMode/src/packages/com/sap/tut/wd/tutwd_table/tablecomp

      Table ShoppingBasket [compatibilityMode]: UIElementEvent not valid TableCompatibilityModeView.wdview TutWD_Table_CompatibilityMode/src/packages/com/sap/tut/wd/tutwd_table/tablecomp

      Message was edited by: Peter Barton

      After double clicking the first error, all the other errors appear (import cannot be resolved, IPrivateTableCompatibilityModeView cannot be resolved (or is not a valid type) for the argument element of the method getTotalPriceAMOUNT TableCompatibilityModeView.java TutWD_Table_CompatibilityMode/gen_wdp/packages/com/sap/tut/wd/tutwd_table/tablecomp line 198

      )

  • avatar image
    Former Member
    Nov 29, 2005 at 12:27 PM

    Hi,

    Please select the value attribute and select the type as "TablecompatibilityMode"

    Regards, Anilkumar

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 23, 2005 at 12:28 PM

    Hallo Peter,

    your problem is based on the fact, that an early version of the Net Weaver Developer Studio (NW04 SP 13) does not use the newest plugin version of the dictionary simple types (Web Dynpro UI element enumeration types). Consequently you cannot declare all bindings and definitions which are based on the 'TableCompatibiltyMode' simple type.

    Two solutions exist for solving your problem:

    A) Upgrade to NW04 SP 14 if possible

    <u><b>B) Replace some static declarations at designtime by a dynamic approach based on generic custom coding.</b></u>

    • delete the context attribute 'TableCompatibilityMode'

    • delete the databinding of the table-property 'compatibilityMode' and set it to 'auto' again

    • delete the selectedKey-databinding of the table's ToolBarDropDownByKey UI-element (ID 'TableSelectionMode')

    • implement the following lines of code within the view controller TableCompatibilityModeView.java

      
    //@@begin javadoc:wdDoInit()
      /** Hook method called to initialize controller. */
      //@@end
      public void wdDoInit()
      {
        //@@begin wdDoInit()
        ...
        // dynamically add context attribute 'TableCompatabilityMode'
        wdContext.getNodeInfo().addAttribute(
          TableCompatibilityModeView.TABLE_COMPATIBILITY_MODE,
          "ddic:com.sap.ide.webdynpro.uielementdefinitions.TableCompatibilityMode");
    
        // initialize context attribute 'TableCompatibilityMode' using generic context API method
        wdContext.currentContextElement().setAttributeValue(
          TableCompatibilityModeView.TABLE_COMPATIBILITY_MODE,
          WDTableCompatibilityMode.NW04_PLUS);
    
        //@@end
      }
    
    public static void wdDoModifyView(IPrivateTableCompatibilityModeView wdThis,
     IPrivateTableCompatibilityModeView.IContextNode wdContext, 
    com.sap.tc.webdynpro.progmodel.api.IWDView view, 
    boolean firstTime)
      {
        //@@begin wdDoModifyView
        if (firstTime) {
          IWDTable table = (IWDTable) view.getElement("ShoppingBasket");
          ...
          // set attribute info for dynamically added context attribute 'TableCompatibilityMode'
          IWDAttributeInfo attributeInfo =
            wdContext.getNodeInfo().getAttribute(
              TableCompatibilityModeView.TABLE_COMPATIBILITY_MODE);
    
          // dynamically bind the table's compatibilityMode property to the dynamically 
          // added context attribute 'TableCompatibilityMode'.
          table.bindCompatibilityMode(attributeInfo);
    
          // dynamically bind the DropDownByKey UI element's selectedKey property to the dynamically 
          // added context attribute 'TableCompatibilityMode'.
          IWDToolBarDropDownByKey dropDownByKey =
            (IWDToolBarDropDownByKey) view.getElement("TableSelectionMode");
          dropDownByKey.bindSelectedKey(attributeInfo);
    
        }
        //@@end
      }
      
    
    ...
    
      //@@begin others
      // store context attribute name in constant TABLE_COMPATIBILITY_MODE
      private static final String TABLE_COMPATIBILITY_MODE =
        "TableCompatibilityMode";
      //@@end

    By the way; this code demonstrates how to dynamically add a new context attribute of type 'TableCompatibilityMode'.

    Also look at these SAP Online Help document: Assignment" target="_blank">http://help.sap.com/saphelp_nw04/helpdata/en/42/c04c950ad21d65e10000000a1553f6/frameset.htm">Assignment of Dictionary Types and Java Types and

    Typing" target="_blank">http://help.sap.com/saphelp_nw04/helpdata/en/4c/40ba420db1cc66e10000000a1550b0/frameset.htm">Typing Context Attributes for Data Binding

    Best regards, and a Merry Christmas,

    Bertram

    Add comment
    10|10000 characters needed characters exceeded