Skip to Content
avatar image
Former Member

sap.m.tabel row selection should trigger navigation to other view with data

Hi,

Please suggest approach with possible methods and sample code which should trigger navigation to other view with data upon selecting row of sap.m.tabel values which is coming from OData.

Sample Code of view:

<core:View

  controllerName="components.xyz.view.Master"

  xmlns="sap.m" xmlns:core="sap.ui.core">

  <Page title="{i18n>Title}">

  <Panel id="pn1" visible="true" headerText="xyz" width="100%"

  height="auto" expandable="true" expanded="false" expand="">

  <Table id="table" itemPress="handleListItemPress" selectionChange="handleListSelect"

    inset="false"

    items="{

      path: '/EntitySet',

      sorter: {

        path: 'Name'

      }

    }">

   <headerToolbar>

     <Toolbar visible="false">

      <Label text="Products" visible="true"></Label>

      <ToolbarSpacer></ToolbarSpacer>

      <Button  icon="sap-icon://download" visible="true" press="onDataExport" />

      </Toolbar>

    </headerToolbar>

    <columns>

      <Column

        id="statusCol"

        minScreenWidth="Tablet">

        <Text text="Status" />

      </Column>

      <Column

        id="vendorCol"

        minScreenWidth="Tablet"

        demandPopin="true">

        <Text text="statu2" />

      </Column>

      <Column

        id="vendoriIdCol"

        minScreenWidth="Tablet"

        demandPopin="true">       

        <Text text="ID" />

      </Column>

      <Column

        id="productsCol"

        minScreenWidth="Tablet"

        demandPopin="true">

        <Text text="Products" />

      </Column>

      <Column

        id="uploadCol"

        minScreenWidth="Tablet">

        <Text text="Uploaded date" />

      </Column>

      <Column

        id="uploadColl"

        minScreenWidth="Tablet">

        <Text text="Uploaded by" />

      </Column>

    </columns>

    <items>

      <ColumnListItem>

        <cells>

          <Text

          text="{ZStatus}"/>

          <Text

            text="{ZName}" />

          <ObjectIdentifier

            text="{ZId}" />

          <ObjectNumber

            number="{ZProc}"/>

          <ObjectNumber

          number="{Ztamp}"/>

          <Text

            text="{UsmdChangedBy}" />         

        </cells>

      </ColumnListItem>

    </items>

  </Table>

</Panel>

  </Page>

</core:View>

Regards,

Koti Reddy

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Dec 25, 2014 at 03:45 PM

    Hi Koti,

    I show you an example to how to do that: JS Bin - Example

    You can do that using other methods as setBindingContext of page: JsDoc Report

    Best regards,

    Pau

    Add comment
    10|10000 characters needed characters exceeded