cancel
Showing results for 
Search instead for 
Did you mean: 

Example ---Defining Cell Variants: TableSingleMarkableCell-Getting error

Former Member
0 Kudos

Hi All,

We are trying an example of cell variant concept of table as given in NetWeaver help. But after deploying we are getting folllowing error. Please guide me.

<b>Create a value attribute attributePointer, switch to the Properties, click … for the property type, and select the Java Simple Type. Enter com.sap.tc.webdynpro.progmodel.api.IWDAttributePointer and confirm with Ok</b>---

I am not able to get this type..I have chosen ---com.sap.ide.webdynpro.uielementdefinitions.AttributePointer

Thanks in Advance,

Gangadhar.

-


<b>Error we are getting is</b>

java.lang.NoClassDefFoundError: com/sap/tc/webdynpro/clientserver/uielib/standard/api/IWDAbstractTableColumn

at java.lang.Class.getDeclaredConstructors0(Native Method)

at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)

at java.lang.Class.getConstructors(Class.java:865)

at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:68)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.<init>(DelegatingView.java:41)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.createUninitializedView(ViewManager.java:486)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:523)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:421)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:130)

at com.sap.tc.webdynpro.progmodel.view.InterfaceView.initController(InterfaceView.java:41)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.displayToplevelComponent(ClientComponent.java:135)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:404)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:618)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:48)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

-


<b>Example we are trying is</b>

You need the option to select a single cell to provide a value help for individual cells, for example.

The interface TableSingleMarkableCell allows you to group cell variants in any way as you like and to make a single cell selectable in this group. The following example shows how to proceed if you want to implement a selection of a single cell from an entire table.

Prerequisites

You have created an applicaton with a component and view in your Web Dynpro project.

Procedure

Creating the Context

...

1. Create a value node TableNode for the data of the table and insert three value attributes of the type String for the table columns.

2. Create a value attribute selectedCellVariant of the type String in the TableNode.

3. Create a value attribute attributePointer, switch to the Properties, click … for the property type, and select the Java Simple Type. Enter com.sap.tc.webdynpro.progmodel.api.IWDAttributePointer and confirm with Ok.

Creating the View

...

1. Open the context menu in the Outline, select Apply Template and then Table. In the subsequent dialog box from the context, select three attributes for the columns (col1, col2, col3). Confirm by choosing Finish

2. Set the property selectionMode of the table to none.

Repeat the steps for each column.

3. Highlight the column and open the context menu. Select Insert Cell Variant, TableSingleMarkableCell and confirm with Finish.

4. Enter the same value for each TableSingleMarkableCell for the property variantKey - for example, variant1

5. Insert a cell editor of the type TextView in each TableSingleMarkableCell.

Binding the UI Elements

...

1. Bind the text property of each TextView to the column in which the property is contained.

2. Bind the attributeToMarkproperty of the corresponding TableSingleMarkableCell to the column in which the element is contained.

3. Bind the selectedCellVariantproperty of each TableColumn to the context attribute selectedCellVariant.

4. Add the following source code to the wdDoInit method.

wdDoInit()

1

2

3

IPrivateUseSingleMarkableCellsView.ItableNodeElement elem;

int count = 10;

// Fill dummy data

for(int i=0; i<count; i++) {

elem = wdContext.nodeTableNode().createTableNodeElement();

wdContext.nodeTableNode().addElement(elem);

elem.setCol1(“1.” + i);

elem.setCol2(“2.” + i);

elem.setCol3(“3.” + i);

// set TableSingleMarkableCell as a variant for the table

elem.setSelectedCellVariant(“variant1”);

}

For each element that is created in the for loop and is then added, the

TableSingle MarkableCell is set as a cell variant in row 3.

5. Add the following source code to the wdDoModifyView method.

wdDoModifyView()

IWDAttributeInfo markedDataInfo = wdContext.currentContextElement().getAttributePointer(“attributePointer”).getAttributeInfo();

((IWDTableSingleMarkableCell) view.getElement(“TableSingleMarkableCell1”)).bindMarkedData(markedDataInfo);

((IWDTableSingleMarkableCell) view.getElement(“TableSingleMarkableCell2”)).bindMarkedData(markedDataInfo);

1. ((IWDTableSingleMarkableCell) view.getElement(“TableSingleMarkableCell3”)).bindMarkedData(markedDataInfo);

The current AttributeInfo is now retrieved at every change of the view and is bound to the context using the markedDataproperty.

Result

Each single cell can be selected separately. You can define an action and in its method, you can determine the coordinates of the currently selected cell using the following code:

IWDAttributePointer attPointer = wdContext.currentContextElement().getAttributePointer();

Message was edited by:

Gangadharayya Hiremath

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gangadhar,

at first: you are right: you have to choose

com.sap.ide.webdynpro.uielementdefinitions.AttributePointer

and not the other one. I already updated the documentation for this.

In which SP are you working?

Kind Regards

Stefanie

Former Member
0 Kudos

Hi Stefanie,

Thanks a lot for your reply. Our WAS version 6.40 and SP 19.(Portal-6.0.19.0.0)6.40 SP19.

Can we have Cell Variant feature of table with this SP??

One more question--Can we use different fonts for different cells of table with input fields as Table Cell Editor. If yes please let us know how to go about??

Thanks in advance,

Gangadharayya.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Gangadharayya,

you cannot use cell variants with NW2004, you need NW2004s for it.

If you want to change fonts, you have to work on the theme, you cannot do this inside WD. I don't think that it's possible to distinguish the font inside one table in different cells, but I also can't see a use case for it.

Kind Regards

Stefanie

Stefanie Bacher

Former Member
0 Kudos

also read cell variant in help:

http://help.sap.com/saphelp_erp2005vp/helpdata/en/ad/c36d42b0ee9041e10000000a1550b0/frameset.htm

Message was edited by: Stefanie Bacher

Stefanie Bacher