listview in JQuery Mobile via Domino Access Service

Here follows an quick example how to create a listview in JQM created with data from a view via DAS. As data source I have used the infamous Fake Names Address book which you can (still) can find on Codestore.

In the example you can navigate between the view (People view) and details (Person view).



I have not really find out (yet) how to add the next set of documents when you scroll down the list (to be continued, or drop the solution in the comments or send me an email).

<?xml version=”1.0″ encoding=”UTF-8″?>
<xp:view xmlns:xp=””&gt;
<xp:dominoView databaseName=”apps\fakenames.nsf”
viewName=”People” var=”viewPeople”>
<xp:script src=”/global/jquery/jquery.js” clientSide=”true”></xp:script>
<xp:script src=”/global/jquery/” clientSide=”true”></xp:script>
<xp:styleSheet href=”/”></xp:styleSheet>

<xp:scriptBlock id=”scriptBlock1″>
<xp:this.value><![CDATA[$(document).on(‘pageinit’, function () {

url: ‘http://dev1//apps/fakenames.nsf/api/data/collections/name/People&#8217;,
type: ‘GET’,
async: true,
success: function (result) {
error: function (request, error) {
alert(‘Network error has occurred please try again!’);

$(document).on(‘pagebeforeshow’, ‘#headline’, function () {

$.each(movieInfo.result, function (i, row) {
if (row[“@position”] == {
$(‘#movie-data’).append(‘<li><img src=””></li>&#8217;);
$(‘#movie-data’).append(‘<li>Name: ‘ + row.$17 + ‘</li>’);
$(‘#movie-data’).append(‘<li>Company’ + row.CompanyName + ‘</li>’);
$(‘#movie-data’).append(‘<li>UNID : ‘ + row[“@unid”] + ‘</li>’);


var movieInfo = {
id: null,
result: null

$(document).on(‘vclick’, ‘#movie-list li a’, function () { = $(this).attr(‘data-id’);
$.mobile.changePage(“#headline”, {
transition: “slide”,
changeHash: false

var ajax = {
handleData: function (result) {
movieInfo.result = result;
$.each(result, function (i, row) {
$(‘#movie-list’).append(‘<li><a href=”” data-id=”‘ + result[i][“@position”] + ‘”><img class=”yourProductSprite yourProductSprite-NoPhotoPerson32″ + src=””/><h3>&#8217; + result[i].$16 + ‘</h3><p>’ + result[i].CompanyName + ‘ / ‘ + result[i].$12 + ‘</p></a></li>’);

<div data-role=”page” id=”home”>
<div data-theme=”a” data-role=”header”>
Pretenders Directory
<div data-role=”content”>
<div class=”example-wrapper” >
<ul data-role=”listview” id=”movie-list” data-theme=”a”>

<div data-theme=”a” data-role=”footer”>
<h1>Fake Names – Codestore</h1>
</div><!– /page –>

<div data-role=”page” id=”headline”>
<div data-theme=”a” data-role=”header”>
<a href=”#home” class=”ui-btn-left” data-transition=”slide” data-direction=”reverse”>Back</a>
<h3>Person details</h3>
<div data-role=”content”>
<ul data-role=”listview” id=”movie-data” data-theme=”a”></ul>
</div><!– /details –>

One thought on “listview in JQuery Mobile via Domino Access Service

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s