on 01-31-2015 6:08 AM
Hi,
I am adding all columns and items data of sap.m.table declaratively other than first column for which column should display data as hyperlink.Hyperlinks will call different applications based on customdata property attached.
Please help me to convert to xml view as I am facing a bit difficulty to attach template to column.
oTable.addColumn(new sap.m.table.Column({
label : new sap..commons.Label({
text : "LinkColumn",
wrapping : true
}),
template : new sap.ui.commons.Link({
tooltip : "Click to go the details page",
press : this.getController().goToDetails
}).bindProperty("text", "User").addCustomData(new sap.ui.core.CustomData({
key : "step",
value : "{step}"
})).addCustomData(new sap.ui.core.CustomData({
key : "action",
value : "{step}"
})).
})),
Regards,
Koti Reddy
How about this:
<Table items="{/yourData}">
<columns>
<Column>
<Label text="LinkColumn" />
</Column>
<!-- etc -->
</columns>
<items>
<ColumnListItem>
<cells>
<Link text="{user}" press="handleLinkPress">
<customData>
<core:CustomData key="step" value="{step}" />
<core:CustomData key="action" value="{step}" />
</customData>
</Link>
<!-- etc -->
</cells>
</ColumnListItem>
</items>
</Table>
As 'customData' is an aggregation of the control, you should add it as such. And since the 'CustomData' object is in a different namespace as sap.m, you should adapt the xmlns accordingly (I have prefixed it here as 'core')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Koti
Is there a reason why are using mixing sap.m and sap.ui.commons controls?
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
I think you referred to sap.ui.commons.link template under sap.m.table definition. Actually I didn't mix up controls but for sample code I posted sap.ui.commons table code and just changed table property to sap.m.table and forgot to change other controls to mobile library in this post.
I used only mobile library only in my code Thanks for reminding.
Regards,
Koti Reddy
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.