Search code examples
orbeon

Orbeon 'send' action - can hidden fields be submitted as blanks?


With the send action the prune option allows the values for hidden not to be sent. This means that the "non-relevant" nodes for those values are not included in the XML. In our case we would like those nodes to be included, but empty/blank.

We are storing data for a set of forms as a single dataset. The mapping of form fields to the dataset is done using the name of the field/control. If the node isn't included then the value in our dataset will not be updated. In other words, we can have this situation:

  1. The user answers "yes" to "Will you be cutting trees?"
  2. The question "How many trees?" is displayed and the user answers "10".
  3. The user submits
  4. The user changes the answer to "Will you be cutting trees?" to "no"
  5. The user submits

Result:
"Will you be cutting trees?" = no
"How many trees?" = 10

Is there a way around this?

If there isn't a way currently, would it be possible for prune to support another option like values to support this?


Solution

  • EDIT:

    As of Orbeon 2017.1 this is now possible using the nonrelevant parameter for send. See documentation.

    Original Answer:

    It makes sense but it's not possible right now. We have an RFE for it which seems to be exactly what you are looking for. I can't see of an easy workaround at this time.