here we will create field and we will give data element.
open vs code--- click on view---then command palette---then explore and install generator.
<mvc:View xmlns:core="sap.ui.core" controllerName="functionimport.controller.Home"
xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<App >
<Page id="page" title="{i18n>title}">
<customHeader>
<Bar >
<contentLeft>
<Label />
<Title text="Designation"/>
<Select selectedKey="SELECT" id="designationsearchid" change="onPress">
<items>
<core:Item text="-----Select one------" key="SELECT"></core:Item>
<core:Item text="DEVELOPER" key="DEVELOPER"></core:Item>
<core:Item text="TESTER" key="TESTER"></core:Item>
</items>
</Select>
</contentLeft>
</Bar>
</customHeader>
<content>
<Table items="{data>/}">
<columns>
<Column >
<Text text="NAME"></Text>
</Column>
<Column >
<Text text="EMAIL"></Text>
</Column>
<Column >
<Text text="PHONE"></Text>
</Column>
<Column >
<Text text="AGE"></Text>
</Column>
<Column >
<Text text="DESIGNATION"></Text>
</Column>
</columns>
<items>
<ColumnListItem >
<cells>
<Text text="{data>Name}"></Text>
</cells>
<cells>
<Text text="{data>Email}"></Text>
</cells>
<cells>
<Text text="{data>Phone}"></Text>
</cells>
<cells>
<Text text="{data>Age}"></Text>
</cells>
<cells>
<Text text="{data>Designation}"></Text>
</cells>
</ColumnListItem>
</items>
</Table>
</content>
</Page>
</App>
</mvc:View>
onPress:function(){
debugger
var selectedKey=this.getView().byId("designationsearchid").getSelectedKey()
var oModel=this.getView().getModel('data')
var oContext=this;
var oDataModel=this.getOwnerComponent().getModel()
var arr=new Array();
oDataModel.callFunction(
"/ZAP_FunctionDemo", {
method:"GET",
urlParameters:{
DESIGNATION:selectedKey
},
success:function(oData,response){
arr=oData.results
oModel.setData(arr)
oContext.getView().setModel(oModel);
debugger
},
error:function(oError)
{
}
}
);
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |