Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search


Home > work with HTML forms
xpageswiki.com
is maintained by 
Julian Buss.
You can hire me.

work with HTML forms

ShowTable of Contents

Get HTTP Post data you received from another source


If your xpages is called in another form's action, and that form transfers it's data as HTTP post data, you can read that data as follows:

param.toString()


Or if you already know what value you would like to read, use this:

param.get( 'parameterName' )


You can archieve the same with the following code:
var request:com.sun.faces.context.MyHttpServletRequestWrapper = facesContext.getExternalContext().getRequest();
return request.getParameterValue("myvalue")


Thanks to Tommy Valand for telling me about the build-in param map.

Convert HTTP Post data from one charset to another


A java servlet always interprests the data of an http request in ISO-8859-1 charset, and so does the XPage engine, too.
If the sender sends the data in UTF-8 or any other charset, you can convert it with:

var data = param.toString();
data = new java.lang.String(data.getBytes("ISO-8859-1"), "UTF-8");

Embed a custom HTML form in a XPage


Per default, each XPage is rendered with a <form> tag.
You can disable that in the "All properties" section of the XPage -> basics -> create form = false. But then a lot of XPages functionality will not work.

But you can use the XPage default form and your own HTML forms side by side using the <xp:form> tag.
Just use the <xp:form> tag somewhere in your XPage where you use XPage functionality (buttons, partial updates etc.). Then close that tag and write your own HTML form tag.

Example:

... standard XPage code ...
<xp:form>
...some XPage code, for example a button running a partial update...
</xp:form>
<form action="http://some.url..." method="post">
<input type="hidden" name="example" value="somevalue"/>
... other HTML form stuff ...
</form>

Created by benny on Sep 13, 2011 3:31:58 PM

great for me !


Created by Samuel on Apr 5, 2012 8:05:32 AM

how to use the ServerSide Javascript to get a html element,for example ,i wanna get a input text value.how can i do this?


Add Comment

Name:
Comments:
How to take your XPages App to the iPhone, iPad, Android: use Domino To Go!
Do you look for an XPages Workflow solution? Take YouAtNotes Workflow.