on 09-03-2014 3:41 PM
hi all,
I am trying to get the value of selected item from search help table in input field and i am using sap.m.Table. for search help i have used sap.ui.ux3.ToolPopup and I am using XML view.
xml code:
<ux:ToolPopup id="toolpopup" modal="true" inverted="flase"
title="Selct Guest House Id" opener="aghid" closed="hclosed" >
<!-- <Button icon="sap-icon://sys-cancel" press="helpClose"/> -->
<Table selectionChange="selectitem" id="helptable" items="{/es_triconGhouse}" mode="SingleSelectMaster">
<columns>
<Column>
<Label text="Guest House Id" />
</Column>
<Column>
<Label text="Guest House Name" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text id="ttt" text="{GhouseID}" />
<Text text="{GhouseName}" />
</cells>
</ColumnListItem>
</items>
</Table>
controller code:
hclosed: function (oEvent) {
// return selected tabled line/value
var oCore = sap.ui.getCore();
var tId = oCore.byId("aghid");
alert(tId);
var oContext = tId.getContextByIndex(tId.getSelectedItem());
alert(oContext);
if (oContext) {
var oSel = oContext.getModel().getProperty(oContext.getPath());
tId.setValue(oSel["GhouseID"]);
};
}
so i am getting the table id but the error is occurring on line no 6 .
so can anyone please help me to get it done.
Thanks and regards,
Prashant
It seems you're not getting the id of your table (which has id 'helptable') but the opener control 'aghid', whatever that may be.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.