How does one set a value in a link/button action, then save?

  • I need to set a field on the client side, and have the data from that field visible to a LotusScript Agent on the server side. This field can’t be visible in the browser. Traditionally this has been done like this:

If put on a normal non-Xpage Form rendering as pass-thru HTML, this is well-nigh trivial to do, and client side JavaScript can fiddle with it as needed.

This appears to be impossible on a XPage. I found a post by Paul Hannan () that says to set the component rendererType to javax.faces.hidden to work around this. That does not work. It does cause the field to be “hidden”, in that it does not appear in the HTML at all. Nor does this work:

var fieldID="#{javascript:getClientId('fieldID')}";

alert("field is "+document.getElementById(fieldID).value);

It says that document.getElementById(fieldID) is null, meaning the browser can’t see it, though fieldID is in fact set to the mangled ID for the field, so something knows that exists and can compute it’s correct ID, on the server side. At the client side it’s gone.

  • I see no way to set a field, and have that field appear in an Agent. I must be missing something. It’s inconceivable that something so fundamentally basic to web sites can’t be done.

Thanks for your time…

Subject: Try using css to hide the field in the browser

If you are using style sheets then create a class with the following value:

.hidden { display: none; }

Then for the styleClass property for the field specify “hidden” (no quotes though).

Subject: Thanks Ernie!..

  • Turns out half the battle is the “modifyField” simple action. I can use that on a link control to set a value.

  • The other half of the battle is still underway, which must run in an onunload event. I can set code to run onunload, and a get a browser field to be hidden, but I can’t get it to bind to a field on the document. I’ll try this and see what happens…