Computed Back Button Demo for XPages Mobile Applications

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">

	<xe:singlePageApp id="singlePageApp1"
		selectedPageName="p01">
		<xe:djxmHeading id="djxmHeading1" label="Back Button Demo">
			</xe:djxmHeading>		
		<xe:appPage id="appPage01" pageName="p01">
			<xe:djxmLineItem id="djxmLineItem2" label="Go to All Documents"
				moveTo="#p02a">
			</xe:djxmLineItem>
			<xe:djxmLineItem id="djxmLineItem1" label="Go to By Category"
				moveTo="#p02b">
			</xe:djxmLineItem>			
		</xe:appPage>
		<xe:appPage id="appPage02a" pageName="p02a">
			<xe:djxmHeading id="djxmHeading2" label="All Documents"
				back="home" moveTo="p01">
				<xe:this.rendered><![CDATA[#{javascript:sessionScope.from = "p02a";
return true;}]]></xe:this.rendered>
			</xe:djxmHeading>
			<xp:text escape="true" id="computedField4" value="#{sessionScope.from}">
			</xp:text>
			<xe:dataView id="dataView1" pageName="#p03"
				openDocAsReadonly="true">
				<xe:this.data>
					<xp:dominoView var="view1" viewName="xpAllDocuments"></xp:dominoView>
				</xe:this.data>
				<xe:this.summaryColumn>
					<xe:viewSummaryColumn columnName="Topic"></xe:viewSummaryColumn>
				</xe:this.summaryColumn>
			</xe:dataView>
		</xe:appPage>
		<xe:appPage id="appPage02b" pageName="p02b">
			<xe:djxmHeading id="djxmHeading3" label="By Category"
				back="home" moveTo="p01">
				<xe:this.rendered><![CDATA[#{javascript:sessionScope.from = "p02b";
return true;}]]></xe:this.rendered>
			</xe:djxmHeading>
			<xp:text escape="true" id="computedField3" value="#{sessionScope.from}">
			</xp:text>
			<xe:dataView id="dataView2" pageName="#p03"
				collapsibleCategory="true" openDocAsReadonly="true">
				<xe:this.data>
					<xp:dominoView var="dominoView1" viewName="xpCategorized"></xp:dominoView>
				</xe:this.data>
				<xe:this.summaryColumn>
					<xe:viewSummaryColumn columnName="Topic"></xe:viewSummaryColumn>
				</xe:this.summaryColumn>
				<xe:this.categoryColumn>
					<xe:viewCategoryColumn columnName="_Categories"></xe:viewCategoryColumn>
				</xe:this.categoryColumn>
			</xe:dataView>
		</xe:appPage>
		<xe:appPage id="appPage03" pageName="p03" resetContent="true">
			<xe:djxmHeading id="djxmHeading5" label="Document Page"
				back="computeBack">
				<xe:this.moveTo><![CDATA[#{javascript:var from = sessionScope.get("from"); 
return from}]]></xe:this.moveTo>
			</xe:djxmHeading>
			<xp:text escape="true" id="computedField2" value="#{sessionScope.from}">
			</xp:text>
			<xp:br />
			<xp:panel>
				<xp:this.data>
					<xp:dominoDocument var="document1" formName="MainTopic">
					</xp:dominoDocument>
				</xp:this.data>
				Subject:&#160;
				<xp:inputText id="inputText1" value="#{document1.Subject}">
				</xp:inputText>
				<xp:br></xp:br>
				<xp:text escape="false" id="computedField1" value="#{document1.Body}">
				</xp:text>
				<xp:br></xp:br>
			</xp:panel>
		</xe:appPage>
	</xe:singlePageApp>
</xp:view>





Add the following to any Discussion app that is enabled to use the XPages Extension Library

XPages
Paul Hannan
March 21, 2012 12:31 PM
Rating
271

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.



No comments yetLogin first to comment...