1

I have a form defined in share-config-custom.xml and have supplied a submission-url so that I can handle some custom stuff whilst editing the node. I have noticed that the nodeRef of the node being edited with the form is not supplied to the backend Java webscript and require it so that I know which node is being edited.

<config evaluator="node-type" condition="elab:variableDefinitions">
    <forms>
        <form submission-url="/metadatacat/node/variableDefinitions>

The above code works fine, calls the Java webscript and supplies all the field values as expected, but when I'm using this to edit a node rather than create (in which case I would have responsibility to create the node) I need a way to supply the nodeRef.

If I try to do any ${nodeRef} injection into the url I just get it added as a literal string rather than it being evaluated first.

<form submission-url="/metadatacat/node/variableDefinitions?noderef=${nodeRef}">

Do I need to supply a custom form template or something to allow me to have more dynamic control over the values being passed to the submission-url? Or is there something I've missed with dynamic inject of nodeRef values within share-config-custom.xml?

Thanks, Stephen

StephenL
  • 122
  • 1
  • 11
  • One other approach I attempted which may have worked is using a custom form processor but I had problems with it finding the correct form template so I followed Abbas' approach. – StephenL Mar 13 '19 at 15:03

1 Answers1

2

Yes, you will require a custom form template(ftl) and js along with your form if you want any additional customization with the OOTB forms processing. this might help you get started

Abbas Kararawala
  • 1,254
  • 12
  • 19
  • 1
    Thanks, this seems to be working but I had to change something in the example (from the link supplied) to get it to work. I changed `<#list form.items as item>` to `<#list form.structure as item>` and it worked after adding extra parameters to the `action="${form.submissionUrl}` of the custom form. – StephenL Mar 13 '19 at 15:01