Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question