Hello Friends,
Using below code i am able to see the Rows into the sap.m.Table. when i change the code from "onAfterRendering" to "onInit: function()". its not working. i did debugging. i didn't understand. Can you please help me.
Controller.js
onAfterRendering: function() { var oModel = this.getView().getModel("ManualQuoteModelLineItems"); this.getView().byId("lineItemsList1").setModel(oModel); }
View.XML
<Table class="myCustomText" id="lineItemsList1" mode="MultiSelect" items="{/manualQuoteDataLineItem}"> <columns> <Column demandPopin="true" hAlign="Center" id="articleColumn1" minScreenWidth="Tablet" popinDisplay="Inline"> <Text class="myCustomText" text="Article" textAlign="Center"/> </Column> <Column demandPopin="true" hAlign="Center" id="descriptionColumn1" minScreenWidth="Tablet" popinDisplay="Inline"> <Text class="myCustomText" text="Qty"/> </Column> <Column demandPopin="true" hAlign="Center" id="quantityColumn1" minScreenWidth="Tablet" popinDisplay="Inline"> <Text class="myCustomText" text="UoM"/> </Column> <Column demandPopin="true" hAlign="Center" id="grossWeightColumn1" minScreenWidth="Tablet" popinDisplay="Inline"> <Text class="myCustomText" text="Description"/> </Column> </columns> <ColumnListItem visible="true" class="myCustomText" id="detailsListItem1"> <cells> <Input id="articaleId" value="{Article}" editable="true" maxLength="18" width="70%" class="sapMTableContentMargin" showValueHelp="true" valueHelpRequest="OnSelectArticle" submit="onEnterArticale" liveChange="onChangeArticle"/> <Input id="QtyId" value="{Qty}" editable="true" maxLength="10" width="40%" class="sapMTableContentMargin" submit="onEnterArticaleonQty" liveChange="onChangeQty" /> <Text id="UoMId" text="{UoM}" visible="true" width="20%" class="sapMTableContentMargin" /> <Text id="descId" text="{DESC}" visible="true" width="100%" class="sapMTableContentMargin" /> </cells> </ColumnListItem> </Table>
manifest.json
"models": { "ManualQuoteModelLineItems": { "type": "sap.ui.model.json.JSONModel", "uri": "model/ManualQuoteLineItem.json" } }
ManualQuoteLineItem.json
{ "manualQuoteDataLineItem": [{ "Article": "", "Qty": "", "UoM": "", "DESC": "" }, { "Article": "", "Qty": "", "UoM": "", "DESC": "" } ] }
Regards
Vijay