cancel
Showing results for 
Search instead for 
Did you mean: 

How to bind combobox inside sap.m.table..??

former_member187227
Participant
0 Kudos

Hi All,

I want to add row in the sap.m.Table in that one field having combobox. I'm not able to get the value in combobox. I created on json model and bind with table while click add button new row is adding but in combobox value is not binded. pls suggest some idea.

Table Code:

<Table id="idincrementTablea" items="{/}" >

<headerToolbar> <Toolbar> <ToolbarSpacer/> <Button icon="sap-icon://add" press="rowadd" /> </Toolbar> </headerToolbar>

<columns> <Column demandPopin="true" hAlign="Center"> <Label text="Item" design="Bold" /> </Column>

<Column demandPopin="true" hAlign="Center"> <Label design="Bold" text="Material" /> </Column>

<Column demandPopin="true" hAlign="Center"> <Label text="Description" design="Bold"/> </Column>

</columns> <items>

<ColumnListItem id="idincrementTablecolumn"> <cells>

<Text text=""/>

<ComboBox id="matrl" placeholder="Select Type" selectionChange="getval"> </ComboBox>

<Text id="descp" text=""/>

</cells>

</ColumnListItem> </items> </Table>


_routePatternMatch: function(oEvent){

var matrlnum = this.byId("matrl");

var ucrItems = new sap.ui.core.ListItem({ key:"{Maktx}", text:"{Matnr}" });

var cFilters = [new sap.ui.model.Filter("ImPlant", sap.ui.model.FilterOperator.EQ, '1000'), new sap.ui.model.Filter("ImLgnum", sap.ui.model.FilterOperator.EQ, '001')];

var cSorter = new sap.ui.model.Sorter("Matnr");

matrlnum.bindAggregation("items", { path: '/GET_MATERIAL_LISTSet', template: ucrItems, sorters: cSorter, filters: cFilters });

var attach1 = this.byId("idincrementTablea");

obj1={Tabix:"", Matnr:"", Werks:"" }; att1.push(obj1);

var oModelatt = new sap.ui.model.json.JSONModel(att1);

attach1.setModel(oModelatt);

},

former_member492955
Participant
0 Kudos

Hi vinothkumar.t,

Has your issue solved? I face the some issue now.

I want to get value show in the onintial status for the select in a table.

there should be a default value show for the select, and there is a list that the value of list is more than the default value.

I want to get your scenario, how it solved

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member484715
Contributor
0 Kudos

Go to the following URL. Maybe you are trying to do something like the one presented there.

http://plnkr.co/edit/FCrGwsBM4K0E16XFEOEc?p=preview

Regards.