cancel
Showing results for 
Search instead for 
Did you mean: 

Bound data node Node of InteractiveForm must not be empty

vdavis
Product and Topic Expert
Product and Topic Expert
0 Kudos

I have created a web dynpro application with an Adobe Interactive Form. The form is a Tax Registration form that I would like the user to enter data and send the data to the back-end R/3 system.

I have created an AddressNode with data and binded the data to the Interactive Form.

I selected the mode for the interactive form as "updateDataInPDF" at first and I received the message. I then changed the mode to "usePDF" and I still receive the message.

The file deploys okay with an informational message "newer version of file already exists".

Here is a sample of the message that I received in the log:

Bound data node Node(TaxFormComponentView.AddressNode) of InteractiveForm must not be empty!

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Bound data node Node(TaxFormComponentView.AddressNode) of InteractiveForm must not be empty!

at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.renderLeadSelectedElement(XfdRenderer.java:175)

at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.render(XfdRenderer.java:75)

at com.sap.tc.webdynpro.clientserver.renderer.AbstractRenderManager.render(AbstractRenderManager.java:62)

at com.sap.tc.webdynpro.clientserver.adobe.AdobeFormHelper.createPDFDocumentForUIElement(AdobeFormHelper.java:343)

at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:104)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.afterHandleActionEvent(ClientApplication.java:1085)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:393)

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

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

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

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

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

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

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

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

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

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

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

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

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

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

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

Any help you can give would be much appreciated.

Vonda

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Davis,

I guess that u have imported model and mapped it with context of your view. In Interactive form, U are using this context model node as a datasource property.

Now you have to first create one object of that model node and bind it to that node in init method of your view.

For example, If your model node is AddressNode, then

AddressNodeElement node = new AddressNodeElement();

wdcontext.AddressNodeElement().bind(node);

Try like this and then let me know the status.

Do not forget to reward points.

Regards,

Bhavik

uwe_reeder
Explorer
0 Kudos

Hello Bhavik,

Your advice was not different to mine

Hello Vonda,

Is your node mapped? Does the origin node of your mapped node have a parent node? Could it be that the origin's parent is empty? If yes, your Address node remains empty despite the cardinality because it only maps to its origin. And the origin node remains empty because there is no valid parent element.

You could try Bhavik's code. If my assumptions are correct, you should get another exception, a ContextException with the message "no active node to map to".

Regards,

Uwe

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Vonda,

As suggested by Reeder, Check the cardinality of the node. If this node is mapped to controller then, check the cardinality of the node in controller and make sure that you have written your initialization code in controller.

Regards,

Bhavik

Former Member
0 Kudos

Hi Davis,

Give me the code which you have written to initialize the node.

Regards,

Bhavik

vdavis
Product and Topic Expert
Product and Topic Expert
0 Kudos

Here is the code to Initialize.

public void wdDoInit()

{

//@@begin wdDoInit()

IPrivateTaxFormComponentView.IAddressNodeElement newAddressNodeElement = wdContext.createAddressNodeElement();

newAddressNodeElement.setCompanyName("Vonda");

wdContext.nodeAddressNode().addElement(newAddressNodeElement);

//@@end

}

Vonda

uwe_reeder
Explorer
0 Kudos

Hmm, the exception "must not bind an empty collection" is thrown at the end of bind() or after a supply function, if a node of cardinality 1..1 or 1..n is still empty. This does not exactly match the code you have shown.

When exactly is the exception thrown? Is it possible that you have a supply function which is empty?

Regards, Uwe

vdavis
Product and Topic Expert
Product and Topic Expert
0 Kudos

Here is the new error:

Node(TaxFormComponentView.AddressNode): must not bind an empty collection to a Node

vdavis
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks for all of your help. I was able to solve this Bound data Node problem, however I get a new error.

IPrivateTaxFormComponentView$IContextElement.wdSetObject(IPrivateTaxFormComponentView.java:417)

I believe this may have something to do with the binding for the Address Node.

Vonda

vdavis
Product and Topic Expert
Product and Topic Expert
0 Kudos

I have created the AddressNode as a value node and I have value attributes assigned to the node.

For exanple:

Context

-- AddressNode

-- BusinessName

-- CompanyName

I have mapped all of the value attributes to my Adobe Interactive Form to capture all of the data that the user has entered. I have tried the code but received errors since I believe there may be a discrepancy with my code.

vdavis
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Uwe,

I change the properties, cardinality to 1..1 and initializeLeadSelection to true. I still get the error.

Vonda

uwe_reeder
Explorer
0 Kudos

The InteractiveForm needs storage to save the form data in the context. Therefore you bound it to the node "AddressNode". But at runtime a node is a list of elements. The exception tells you that the node "AddressNode" is empty (containing no elements) when the system tried to display the InteractiveForm.

You will have to ensure that your node contains one lead selection element when binding an InteractiveForm to it. You can achieve this by adding one element to the node and then setting the lead selection to its index 0. Or you can set the node's properties so that this occurs automatically. If you set the cardinality to 1..1 or 1..n, the context will automatically add one element and if you set "initializeLeadSelection", the first added element will automatically be selected.

Regards,

Uwe