Skip to main content link. Accesskey S

XPages Wiki

Submit Search

YouAtNotes XPages Wiki


Home > Client JavaScript > Work with Client side JavaScript

Work with Client side JavaScript

ShowTable of Contents

Use the result of a server side script in the client


For example, use the result of a @DbName in your client script:

dbname='#{javascript:@DbName()}';

Get the runtime id of a control


In the XPage you set a name / id for a control, for example "panelSidebar". But at runtime, in the browser, that id is prefixed with some other stuff, so you cannot use "dojo.byId('panelSidebar')" to get the element.
You need to get the runtime id with the following piece of client javascript:

var id = "#{id:nameOfControl}";


For example:

var id = "#{id:panelSidebar}";
dojo.byId(id).innerHTML = "I just dynamically modified the content of a panel.";


Note that this method only works where you can write client javascript in some XPage control.
It does NOT work when you embed JavaScript directly in the source code of the XPage.

Trigger partial update for a certain control


You can use the XSP object to trigger a partial update of a specific control, using the runtime id of that control:

XSP.partialRefreshPost(id);

Other useful XSP functions


XSP.startsWith(string, substring)
XSP.endsWith(string, substring)


returns true if a string starts/ends with a certain substring.

See what's possible with Xpages.
Have a look at our ServiceCommunicator website
and the YouAtNotes Support.
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.
Did this wiki help you?
Did this saved you time? Express your gratitude by making a donation:
PayPal - The safer, easier way to pay online!