The first way I have found was to create a panel with the hidden fields in it and hide with css. But that has the isue, that a user could switch off css in his browser and the hidden fileds are shown again.
The easiest and best way is to set the fields in “querySaveDocument:”.:
In that way no field must be made in the XPage and you can fill all hidden fields in the form. It also works with fields which are set to “computed” in the notesform.
Thanks Wolfgang. The problem I had with that technique is that I was trying to set a readers field, but the name just gets stored as a regular field. I can change the field type to ‘readers’ after I save the document, but saving the doc twice seemed clumsy. I’ve since discovered the ‘computeWithForm’ data property which worked well.
Amongst other things, I wanted to set a readers field for a document created using an XPage. The XPage has an equivalent regular form, and when I use the ‘ComputeWithForm’ option, the saved document has picked up the readers field (as specified on the regular form). Here’s the code from the XPage:
The problem I was having is that setting the value in the ‘querysavedocument’ event meant the field wasn’t stored as a readers field - just text, and I couldn’t get a handle on the field to change its type until after it was saved (hence saving the field twice).
Many thanks for the suggestions. After I wrote my message, I discovered the ‘computeWithForm’ on query save property (under ‘data’), which achieved 90% of what I was wanting to do.
I re-wrote the other 10%, but it was a bit painful, so these techniques will be useful going forward.
tried this suggestion (in 8.5.1) and the field does not show up in the HTML at all. I’m lookng to a type=hidden field in html. It was pointed out to me that there’s a new hidden input field in 8.5.1 but that doesn’t work for me either in any type of repeat control/datatable/view control.