XPages Mobile Control Tutorial - CRUD xsnippet

<?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="homePage">
    <xe:appPage
      id="appPage1"
      pageName="homePage">
      <xe:djxmHeading
        id="djxmHeading1"
        label="Home">
      </xe:djxmHeading>
      <xe:djxmRoundRectList
        id="djxmRoundRectList1">
        <xe:djxmLineItem
          id="djxmLineItem1"
          label="All Documents"
          moveTo="viewPage">
        </xe:djxmLineItem>
      </xe:djxmRoundRectList>
    </xe:appPage>
    <xe:appPage
      id="appPage2"
      pageName="viewPage"
      preload="true"
      resetContent="true">
      <xe:djxmHeading
        id="djxmHeading2"
        label="All Docs"
        back="Back"
        moveTo="homePage">
        <xp:this.facets>
          <xe:toolBarButton
            id="toolBarButton3"
            xp:key="actionFacet"
            label="New">
            <xp:eventHandler
              event="onClick"
              submit="true"
              refreshMode="complete">
              <xe:this.action>
                <xe:moveTo
                  direction="Left to Right"
                  forceFullRefresh="true"
                  targetPage="documentPage"
                  transitionType="slide">
                </xe:moveTo>
              </xe:this.action>
            </xp:eventHandler>
          </xe:toolBarButton>
        </xp:this.facets>
      </xe:djxmHeading>
      <xe:dataView
        id="dataView1"
        rows="10"
        pageName="documentPage"
        openDocAsReadonly="true">
        <xe:this.data>
          <xp:dominoView
            var="view1"
            viewName="($All)">
          </xp:dominoView>
        </xe:this.data>
        <xe:this.summaryColumn>
          <xe:viewSummaryColumn
            columnName="Topic"></xe:viewSummaryColumn>
        </xe:this.summaryColumn>
      </xe:dataView>
    </xe:appPage>
    <xe:appPage
      id="appPage3"
      pageName="documentPage"
      resetContent="true">
      <xp:panel>
        <xp:this.data>
          <xp:dominoDocument
            var="document1"
            formName="MainTopic">
          </xp:dominoDocument>
        </xp:this.data>
        <xe:djxmHeading
          id="djxmHeading3"
          back="Back"
          moveTo="viewPage"
          label="Document">
          <xp:this.facets>
            <xp:panel
              xp:key="actionFacet">
              <xe:toolBarButton
                id="toolBarButton1"
                label="Edit"
                rendered="#{javascript:!document1.isEditable()}">
                <xp:eventHandler
                  event="onClick"
                  submit="true"
                  refreshMode="complete">
                  <xe:this.action>
                    <xp:changeDocumentMode
                      mode="edit"
                      var="document1">
                    </xp:changeDocumentMode>
                  </xe:this.action>
                </xp:eventHandler>
              </xe:toolBarButton>
              <xe:toolBarButton
                id="toolBarButton2"
                label="Save"
                rendered="#{javascript:document1.isEditable()}">
                <xp:eventHandler
                  event="onClick"
                  submit="true"
                  refreshMode="complete">
                  <xe:this.action>
                    <xe:moveTo
                      direction="Right to Left"
                      saveDocument="true"
                      targetPage="viewPage"
                      transitionType="slide">
                    </xe:moveTo>
                  </xe:this.action>
                </xp:eventHandler>
              </xe:toolBarButton>
            </xp:panel>
          </xp:this.facets>
        </xe:djxmHeading>
        <xe:formTable
          id="formTable1">
          <xe:formRow
            id="formRow1"
            label="Subject: ">
            <xp:inputText
              id="inputText1"
              value="#{document1.Subject}">
            </xp:inputText>
          </xe:formRow>
          <xe:formRow
            id="formRow2"
            label="Category: ">
            <xp:inputText
              id="inputText2"
              value="#{document1.Categories}">
            </xp:inputText>
          </xe:formRow>
          <xe:formRow
            id="formRow3"
            labelPosition="none">
            <xp:inputRichText
              id="inputRichText1"
              value="#{document1.Body}">
            </xp:inputRichText>
          </xe:formRow>
        </xe:formTable>
        <xe:tabBar
          id="tabBar1"
          barType="segmentedControl">
          <xe:tabBarButton
            id="tabBarButton1"
            label="Delete"
            rendered="#{javascript:!document1.isNewNote()}">
            <xp:eventHandler
              event="onClick"
              submit="true"
              refreshMode="complete">
              <xe:this.action>
                <xp:actionGroup>
                  <xp:deleteDocument
                    name=""
                    message="This action will delete the current document."
                    var="document1">
                  </xp:deleteDocument>
                  <xe:moveTo
                    direction="Right to Left"
                    forceFullRefresh="true"
                    targetPage="viewPage"
                    transitionType="slide">
                  </xe:moveTo>
                </xp:actionGroup>
              </xe:this.action>
            </xp:eventHandler>
          </xe:tabBarButton>
        </xe:tabBar>
      </xp:panel>
    </xe:appPage>
  </xe:singlePageApp>
</xp:view>





This is the xsnippet of markup that should be generated when following the XPages Mobile Controls Tutorial (http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPages_Mobile_Controls_Tutorial_ ), and is based upon IBM Notes Domino 9.0.1.  

XPages
Paul Hannan
November 22, 2013 7:10 AM
Rating
137

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...