cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering problem with model node

Former Member
0 Kudos

Hi,

I hav created a model and my context structure is like this

Context

--Bapi_material_getlist_input

-


output

-


matnrlist

<list of attributes which are bind to table>

--sourceset

<list of attributes, matnrlist node copied>

--FilterAttributes<1..1 cardinality>

-


Description<attirbute>

Marnrlist is the node wer my data is coming frm r3. i binded this node to table.

I copied matnrlist node to another in the context and renamed it as sourceset

took node filterattributes and attribute description of type string.

After executing model, my node matnrlist will hav list of values.

then after execute model comman, worte the below

wdContext.nodeSourceSet().invalidate();

WDCopyService.copyElements(wdContext.nodeMatnrlist(), wdContext.nodeSourceSet());

setTableSet();

In SetTableSet method, below is the code

WDCopyService.copyElements(wdContext.nodeSourceSet(), wdContext.nodeMatnrlist());

In Action filter, below is the code

wdContext.currentContextElement().getTableFilter().filter( wdContext.nodeSourceSet(), wdContext.nodeMatnrlist());

In domodifyview, below is the code

if (firstTime)

{

IWDTable table = (IWDTable)view.getElement("Table");

wdContext.currentContextElement().setTableFilter( new TableFilter( table, wdThis.wdGetFilterAction(), (IWDNode)wdContext.nodeSourceSet(), null ) );

}

but when i execute my application, i m having list of values in my table with filter field

whatever i write and press enter button in the filter field, i m getting below error,

com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Material_GetList.Bapi_Material_Getlist_Input.Output.Matnrlist): value node is created without a reference

kindly put some light on this...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I cannot answer your question on node filtering.

I usually copy the nodeelements explicitely. This always gives me total control.

Other advantages:

- You can create smaller elements in your value nodes (don't copy what you don't need)

- You can give more meaningful names to attributes in your value elements

- You can analyse and/or consolidate during copying elements.

example:

INode sourceNode = ....;
INode targetNode = ....;

for (int i=0, i<sourceNode.size(); i++) {

IElement sourceElement = sourceNode.get<Name>elementAt(i);
if (check if element must be copied)  {
IElement targetElement = targetNode.create<Name>Element();

targetElement.set<Some>value(sourceElement.get<Corresponding>Value());
.. fill other properties

targetNode.addElement(targetElement);
}

}

Good luck, Roelof

Former Member
0 Kudos

I didnt understand the above code...can u explain it more clearly...

pls...

Thanks in advance..

Former Member
0 Kudos

Hi,

The code above is an alternative way to copy elements from one node to another.

This is generally what you want if you copy model nodes to value nodes.

There is also a template that you can apply that generates this code (partially). Check the 'relate context attributes' template that can be applied to (custom) controllers.

Good luck, Roelof

Answers (1)

Answers (1)

former_member201361
Active Contributor
0 Kudos

Hi Renushree,

Create a separate Value node bind it to the table.

copy the data from the Model node to value node using WDCopyService and do filtering on value nodes instead of Model node.

Thanks and Regards

Former Member
0 Kudos

i done the same..now error has been changed

java.lang.IllegalArgumentException: model object must not be null

former_member201361
Active Contributor
0 Kudos

Hi Renushree,

in which line u are getting this exception?

is ur table is getting filled by values from Backend ?

Thanks and regards

Former Member
0 Kudos

Hi Ahmed,

I m getting values in my Table.

In action filter i m getting error.

I binded my table with the node "Matnrlist", it is model node.

Created another node "sourceset"(it is copied from model node"Matnrlist")

Now i copied all Values which r coimng from model node"Matnrlist" to value node "sourceset" by using below code

WDCopyService.copyElements(wdContext.nodeMatnrlist(), wdContext.nodeSourceSet());

Created anothe node called Filter with the attribute "Description" of type string. and this attribute has been bidned to table column.

In ModifyView, below is the code

if (firstTime) {

IWDTable table = (IWDTable)view.getElement("Table");

wdContext.currentContextElement().setTableFilter( new TableFilter( table, wdThis.wdGetFilterAction(), (IWDNode)wdContext.nodeSourceSet(), null ) );

}

In Action filter, below is the code

wdContext.currentContextElement().getTableFilter().filter( wdContext.nodeSourceSet(), wdContext.nodeMatnrlist());

Kindly provide me some solution to solve my issue.

Thanks in advance,

Renu

former_member201361
Active Contributor
0 Kudos

HI Renu,

In action filter i m getting error.

I believe the error message is Null pointer Exception.

please use this code in doModify method

In ModifyView, below is the code

if (firstTime) {

IWDTable table = (IWDTable)view.getElement("Table");

wdContext.currentContextElement().setTableFilter( new TableFilter( table, wdThis.wdGetFilterAction(), (IWDNode)wdContext.nodeSourceSet(), new Hashtable()) );

}

or please provide the Full exception .

Thanks and Regards

Former Member
0 Kudos

I Tried by inserting the code which provided by you. Still facing the same problem.

In my table i m getting all values..

In filterfield, if i give * and press enter, table got empty...

In filterfiled, if i give any test and press enter, giving belw error.

com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Material_GetList.Bapi_Material_Getlist_Input.Output.Matnrlist): value node is created without a reference

Here is the full exception

com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Material_GetList.Bapi_Material_Getlist_Input.Output.Matnrlist): value node is created without a reference

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.packElement(NodeInfo.java:911)

at com.sap.tc.webdynpro.progmodel.context.MappedNodeElement.<init>(MappedNodeElement.java:36)

at com.sccl.wdp.IPrivateMaterial_GetListView$IMatnrlistElement.<init>(IPrivateMaterial_GetListView.java:852)

at com.sccl.wdp.IPrivateMaterial_GetListView$IContextNode.doCreateElement(IPrivateMaterial_GetListView.java:77)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:884)

at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1351)

at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1370)

at com.sccl.samplemodel.types.TableFilter.filter(TableFilter.java:150)

at com.sccl.Material_GetListView.onActionFilter(Material_GetListView.java:158)

at com.sccl.wdp.InternalMaterial_GetListView.wdInvokeEventHandler(InternalMaterial_GetListView.java:217)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)

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

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)

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

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)

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

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:386)

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

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

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

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

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

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:102)

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

former_member201361
Active Contributor
0 Kudos

Hi Renu,

Please check whether u have done the Mapping between the nodes properly and please follow the steps given in this blog for table filtering.

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5439] [original link is broken] [original link is broken] [original link is broken];

Thanks and Regards

Former Member
0 Kudos

Now error has been changed... I Have checked the blog which u sent more times...I didnt miss anything ahmed..

java.lang.IllegalArgumentException: model object must not be null

at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)

at com.sccl.wdp.IPrivateMaterial_GetListView$ITableSetElement.<init>(IPrivateMaterial_GetListView.java:1327)

at com.sccl.wdp.IPrivateMaterial_GetListView$IContextNode.doCreateElement(IPrivateMaterial_GetListView.java:86)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:884)

at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1351)

at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1370)

at com.sccl.samplemodel.types.TableFilter.filter(TableFilter.java:150)

at com.sccl.Material_GetListView.onActionFilter(Material_GetListView.java:158)

at com.sccl.wdp.InternalMaterial_GetListView.wdInvokeEventHandler(InternalMaterial_GetListView.java:217)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)

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

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)

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

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)

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

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:386)

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

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

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

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

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

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:102)

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

former_member201361
Active Contributor
0 Kudos

Hi Renu,

when are u getting this exception ?

whether u are getting the data from the model and gets displayed for first time and while doing filtering , r u getting this exception?

Please check ur code, whether u are executing the model correctly?

Thanks and regards

Former Member
0 Kudos

I m getting values from model and displaying it in table. But when i try to filter the thing, that time i m getting this exception. Dat means in filter action some wer its througing error

Former Member
0 Kudos

Hi,

Use the Tablefilter.java code given in this thread.

Hope it Helps,

Regards,

Gayathri.

Former Member
0 Kudos

Hi Gayathri...

Still facing thesame problem...

java.lang.IllegalArgumentException: model object must not be null

it might b not problem with tablefilter.java

kindly have a look in to the above issues to knw what i hav done in my application..

kindly put some light on this...

thanks in advance.

Renu

Former Member
0 Kudos

As per the below blog,

/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter

All the nodes should be under the root node context.

But the node which i binded to my table is not under root context. its a sub node.

is it bcoz of that?

Former Member
0 Kudos

model object must not be null

I think the backend call was not successfull and returned null.

Good luck, Roelof

Former Member
0 Kudos

Pls...can anybody solve this issue...

com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Material_GetList.SourceSet): value node is created without a reference

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.packElement(NodeInfo.java:911)

at com.sap.tc.webdynpro.progmodel.context.MappedNodeElement.<init>(MappedNodeElement.java:36)

at com.sccl.wdp.IPrivateMaterial_GetListView$ISourceSetElement.<init>(IPrivateMaterial_GetListView.java:1103)

at com.sccl.wdp.IPrivateMaterial_GetListView$IContextNode.doCreateElement(IPrivateMaterial_GetListView.java:81)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:884)

Former Member
0 Kudos

Any update on this?

former_member201361
Active Contributor
0 Kudos

Hi Renu,

As per the below blog,

/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter

All the nodes should be under the root node context.

But the node which i binded to my table is not under root context. its a sub node.

is it bcoz of that?

why cant u try the table filetring with separate node and check whether it works.(I am not sure whether the problem is due to having a sub node but please make a try).

Thanks and Regards

Former Member
0 Kudos

Hi Ahmed,

I tried in that way also..even though i m facing the same error.