on 11-29-2005 9:34 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please select the value attribute and select the type as "TablecompatibilityMode"
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which errors appear in the "Tasks" view of Eclipse?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
)
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 nodes 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Peter,
Try to reload+rebuild the project. Everything under wdp folder is generated.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try using organize Imports("CTRLSHIFTO") or repair and rebuild the project.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.