cancel
Showing results for 
Search instead for 
Did you mean: 

"Enhancing Web Dynpro Table Performance" tutorial

Former Member
0 Kudos

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/tu... on creating tables in web dynpro - 11_0_.htm (Part B)

Has anyone experienced similar problems? Any solutions?

Greetings

Peter

Accepted Solutions (0)

Answers (6)

Answers (6)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

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: <a href="http://help.sap.com/saphelp_nw04/helpdata/en/42/c04c950ad21d65e10000000a1553f6/frameset.htm">Assignment of Dictionary Types and Java Types</a> and

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

Best regards, and a Merry Christmas,

Bertram

Former Member
0 Kudos

Thanks for this answer.

I've also got the hint to upgrade to SPS14 but i can't do that, so i'll have to wait untill my company updates to SPS15.

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Barton,

you are not happy with my "dynamic" workaround. You can apply it directly instead of waiting until SPS15 is installed. Any questions on this solution?

Regards, Bertram

Former Member
0 Kudos

Hi,

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

Regards, Anilkumar

Former Member
0 Kudos

In TableCompatibilityModeView, i changed to context view, selected the value TableCompatibilityMode an tried to change the type but "TablecompatibilityMode"

isn't selectable as type from the dropdown field and in the "dictionary simple type" popup it isn't included

Former Member
0 Kudos

I got the same problem like you got Peter. Do you have any more news or solution to solve this problem? Please share.

Former Member
0 Kudos

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

Armin

Former Member
0 Kudos

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

)

Former Member
0 Kudos

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

former_member182372
Active Contributor
0 Kudos

Hello Peter,

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

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi,

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

Regards, Anilkumar