cancel
Showing results for 
Search instead for 
Did you mean: 

cannot bind or add elements because the node has no valid parent

Former Member
0 Kudos

I am getting following error when i am trying to add value to model node from value node :-

cannot bind or add elements because the node has no valid parent

Model Node has following structure :-

Zrfmc_Remarks_Input

|_Output

|_Output_IRemarks

I am trying to add value to Output_IRemrks node using following code :-

IPublicCreateCust.IOutputI_RemarksElement ele;

ele = wdContext.createOutputI_RemarksElement(new Ztmc_Remarks());

ele.setAppperson(wdContext.currentRemarksElement().getAppPerson());

wdContext.nodeOutputI_Remarks().addElement(ele);

I also tried using :-

wdContext.nodeZrfcmc_Remarks_Input().nodeOutput().nodeOutputI_Remarks().addElement(ele);

Can anyone suggest what i am doing wrong or proper code.

Regards,

Jigar Oza

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member185086
Active Contributor
0 Kudos

HI

Please have a look on following document It has a detailed discussion for the same.

Best Regards

Satish Kumar

Former Member
0 Kudos

try creating abstract list (|_Output_IRemarks List type) with one element (|_Output_IRemarks type) and set it to the node.

Former Member
0 Kudos

What is your exact requirement?

Why are you adding elementsto the node Output_IRemarks, if you are executing the RFC Zrfmc_Remarks then you need to add/bind elements to Zrfmc_Remarks_Input. Is Output_IRemarks under Output

Former Member
0 Kudos

User will be adding remarks to several line item. If he has already given remarks then he can only view it.

So I am fetching remarks from table thru RFC which is stored in Output_Remarks nodes. Now when user click on Add Remarks button, first i check whther the remark exist for this line item or not

If the remarks does not exist, user can add remarks and clickc on save button. After clicking on save button the remarks is been stored in database, but i also want to add this remark entry to Output_Remarks node so that user cannot add remarks again, as my program checks entries from Output_Remarks node or else i would need to call RFC again to fetch remarks.

Regards,

Jigar Oza

Former Member
0 Kudos

Actually you should be able to add elements to the node,did u try copying the values to the node using copy service.

Why don't you set the Remarks Input Field read only when the RFC updates backend and returns success message and make it editable if the RFC returns error. By this you can skip adding elements to the node Output_Remarks

Former Member
0 Kudos

Hi,

I suggest you to create a value node exactly like Output_Remarks model node in the controller context and populate all the data from Ouput_Remarks node to this value node. You can write for loop or you can use WDCopyService.copyElements() method to copy the elements from model node to value node.

Create one more additional boolean attribute as "isEnteredByUser" in the same value node.

By default this boolean attribute value for all the elements will be false.

Every time when user updates the remarks for a particular entry then go and update the remarks field for that particular entry in the value node. And change "isEnteredByUser" boolean attribute to true.

And every time check whether remarks exist or not in the value node.

Because of this "isEnteredByUser" attribute , you can easily identify the records which are modified at front end while updaing in database.

I dont think it is better to update the Output model node with user input.

Regards,

Charan