API
@-Formulas
JavaScript
LotusScript
Reg Exp
Web Design
Notes Client
XPages
 
XPages Mobile Options
Here are several things I've learned from doing some XPages Mobile development over the last few weeks.

Normally, with a mobile application, you want to have everything loaded up once and then open up different pages without another trip to the server. In my case, the nature of my application leads it to have different parts of the mobile application be different XPages (because there are so many different options - one page would take forever to load).

So, keeping in mind that multiple XPages are used to navigate around, here's the things I learned.

(1) On the title bar (<xe:djxmHeading>) if you want the "Back" button on the left to go to a different page, add a child "href" attribute, as in:

<xe:djxmHeading id="djxmHeading1" label="Administration" back="Home">
    <xe:this.href><![CDATA[#{javascript:return "/<subdir>/home.nsf/mobile.xsp";}]]></xe:this.href>
</xe:djxmHeading>


(2) On the title bar (<xe:djxmHeading>) if you want a button to appear on the right, that is done through an Action Facet panel:

<xe:djxmHeading label="Home">
    <xp:this.facets>
        <xp:panel xp:key="actionFacet">
            <xp:button id="btnLogout" value="Logout">
                <xp:eventHandler event="onclick" submit="false">
                    <xp:this.script><![CDATA[window.location = thisURL + "?logout&redirectTo=/" + webDbName + "/mobile.xsp";]]></xp:this.script>
                </xp:eventHandler>
            </xp:button>
        </xp:panel>
    </xp:this.facets>
</xe:djxmHeading>


(3) If you want a list item that goes to another page, that is done through a Dojo attribute on the line item (which I previously described here):

<xe:djxmLineItem id="djxmLineItem1" label="More Information">
    <xe:this.dojoAttributes>
        <xp:dojoAttribute name="href" value="mobileMoreInfo.xsp">
        </xp:dojoAttribute>
    </xe:this.dojoAttributes>
</xe:djxmLineItem>


(4) If, instead of going to another XPage, you want to run some JavaScript, that is also done through Dojo attributes. Two attributes are needed - one is "clickable" that says the line item can be clicked, and the second is "onclick" which says the function that is supposed to execute when clicked.

<xe:djxmLineItem id="djxmLineItem3" label="Prompt and Redirect">
    <xe:this.dojoAttributes>
        <xp:dojoAttribute name="clickable" value="true">
        </xp:dojoAttribute>
        <xp:dojoAttribute name="onclick" value="promptAndRedirect();">
        </xp:dojoAttribute>
    </xe:this.dojoAttributes>
</xe:djxmLineItem>