cancel
Showing results for 
Search instead for 
Did you mean: 

Add links to SmartTable columns/rows

03-16-2016 6:41 PM
3911 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hello,

I need to create a SmartTable like this:

SAPUI5 Explored

But I don't understand how they create the links in my Bukrs and Customer columns. How it works? It should be defined in Annotations, I already read it from here (), but I'm looking the metadata.xml (https://sapui5.hana.ondemand.com/test-resources/sap/ui/comp/demokit/sample/smarttable/mockserver/met...) and I don't understand how / where they are defining the Navigation there ¿?

Please, any help...

Miguel Angel.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

RameshShrestha
Contributor
0 Likes

Hi Miguel,

You can also add your own columns.

    <smartTable:SmartTable beforeRebindTable="onBeforeRebindFunc" demandPopin="true" editToggled='editToggled' editable="false"  

       enableAutoBinding="true" entitySet="C_entity" header="{i18n>Header}" id="tableGenSmart" persistencyKey="persistentGenSmart"

       showRowCount="true" smartFilterId="smartFilterBarr" tableType="ResponsiveTable" useExportToExcel="false" useTablePersonalisation="false"

       useVariantManagement="false" class="sapUiSmallMarginTop">

        <Table mode="MultiSelect" selectionChange="onGeneratedRowSelectionChange">

       <columns>

        <Column>

       <customData>

       <core:CustomData key="p13nData"

        value='\{"columnKey": "myNameText","leadingProperty": "myNameText","sortProperty": "myNameText","filterProperty": "myNameText"}'/>

       </customData>

       <Label text="{i18n>myLabel}"/>

         

</Column>

</columns>

<items>

    <ColumnListItem>

    <cells>

    <ObjectIdentifier text="{myNameText}" title="{titleText}"/>

    </cells>

</ColumnListItem>

</items>

</Table>

</smartTable:SmartTable>

onBeforRebindTable method, you add the required fields to be added while rendering because smart  Table will render the fields which are just visible.

onBeforeRebindFunc:function(oEvent){

var oBindingParams = oEvent.getParameter("bindingParams");
oBindingParams.parameters = oBindingParams.parameters || {};

oBindingParams.parameters.select = '*'; // for selecting all fields in query or add specific fields

}

And those navigations can come by defining semantic object navigation annotations. For this valid association has be  there and it should be deployed into lauchpad for testing because there are no semantic object in WEB IDE.

Wtih Regards,

Ramesh Shrestha

Former Member
0 Likes

Hi Ramesh,

Thanks for your answer! 🙂

Do you know how to create semantic object navigation annotations? Annotation Term="com.sap.vocabularies.Common.v1.SemanticObject"


We tried to create it, but no luck... we import com.sap.vocabularies.Common file in our OData project, but we are not able to see the "SemanticObject" term...


Any "how-to" document to create / work with semantic object navigation annotations?


Miguel Angel.

RameshShrestha
Contributor
0 Likes

Hi Miguel,

Below link you can check to mannually trigger semantic object navigation through SAPUI5 coding.

For S4 HANA , we can give SemanticObject annotation itself also we can modify it through MPC_EXT but for these annotation I have seen only on S4HANA so I don't have much idea on dependency on which SAP version it is possible. Also it is having some limitation for now. So I would suggest you to add your own column in smart table and on press navigate to semantic object that you specify.

http://stackoverflow.com/questions/27844715/fiori-cross-application-navigation

With Regards,

Ramesh Shrestha

Former Member
0 Likes

Thanks again for your help Ramesh!

We are not working with S4 HANA, and our developers don't want to add the custom column to the SmartTable, they prefer to use the SemanticObject annotation... so we will continue investigating about it for a while... 🙂

Thanks anyway! 🙂

Answers (0)