Bind a Drop Down on every row, added Dynamically on sap.ui.table.TableAdd a New Item to a Table / ListGet Selected Value from Drop-Down Inside sap.ui.table.TableDynamic binding of table column and rowsRow Selection behaviour sap.ui.table.TableMultiselect Drop down with optgroupSelect rows in sap.ui.table.Table ControlOpenUI5: Binding sap.m.ComboBox to a JSONModel() column in sap.ui.table.TableSAPUI5 XML View Binding with parameters from same modelDelete Multiple Rows (sap.ui.table.Table)Get Selected Value from Drop-Down Inside sap.ui.table.TableBinding a dynamic fragment to a viewRows binding in sap.ui.table.Table dynamically

Is an entry level DSLR going to shoot nice portrait pictures?

Group Integers by Originality

Extreme flexible working hours: how to control people and activities?

Why can my keyboard only digest 6 keypresses at a time?

Why didn't Voldemort recognize that Dumbledore was affected by his curse?

How to tell your grandparent to not come to fetch you with their car?

Are there any important biographies of nobodies?

Any way to create a link to a custom setting's "manage" page?

Were Alexander the Great and Hephaestion lovers?

Zeros of the Hadamard product of holomorphic functions

Giant Steps - Coltrane and Slonimsky

What speaks against investing in precious metals?

Playing a Character as Unobtrusive and Subservient, Yet Not Passive

Inward extrusion is not working

Second (easy access) account in case my bank screws up

English word for "product of tinkering"

Soft question: Examples where lack of mathematical rigour cause security breaches?

Why can't I use =default for default ctors with a member initializer list

A IP can traceroute to it, but can not ping

How to trick the reader into thinking they're following a redshirt instead of the protagonist?

Is a lack of character descriptions a problem?

How can I get an unreasonable manager to approve time off?

Can Rydberg constant be in joules?

Thread Pool C++ Implementation



Bind a Drop Down on every row, added Dynamically on sap.ui.table.Table


Add a New Item to a Table / ListGet Selected Value from Drop-Down Inside sap.ui.table.TableDynamic binding of table column and rowsRow Selection behaviour sap.ui.table.TableMultiselect Drop down with optgroupSelect rows in sap.ui.table.Table ControlOpenUI5: Binding sap.m.ComboBox to a JSONModel() column in sap.ui.table.TableSAPUI5 XML View Binding with parameters from same modelDelete Multiple Rows (sap.ui.table.Table)Get Selected Value from Drop-Down Inside sap.ui.table.TableBinding a dynamic fragment to a viewRows binding in sap.ui.table.Table dynamically






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I have created a table with a drop down control. I am adding rows dynamically in my table. I am trying to bind my table column of drop down with a JSONModel but there are some challenges in there.



var oTable = this.getView().byId("myTable");
this.items.push(
item1: "",
item2: "",
item3: ""
);
this.oModelJson.setData(this.items);
this.oTable.setModel(this.oModelJson);
this.oTable.bindRows("/");


Now, my item1 is the drop down as declared in the view. After the end of above code, I am trying to bind my table drop down using following technique: my JSONModel is global and it has data. I am able to successfully bind my drop down outside of table but when I move my drop down inside the table, it is not binding.



var oDDL = this.byId("DropDown");
var oDDLTemplate = new sap.ui.core.Item(
key: "key",
text: "Text"
);
oDDL.setModel(this.oJson);
oDDL.bindAggregation("items", "/results", oDDLTemplate);


Here is my view, Table



<t:Table id="myTable"
width="auto"
noDataText="No Record Found"
busyIndicatorDelay="detailView>/lineItemTableDelay"
class="sapUiResponsiveMargin"
selectionMode="MultiToggle"
visibleRowCount="5"
>
<t:extension>
<l:HorizontalLayout>
<Button icon="sap-icon://add" text="Row" press="addRow"/>
<Button icon="sap-icon://delete" text="Row" press="fDeleteRow"/>
</l:HorizontalLayout>
</t:extension>
<t:columns>
<t:Column width="16rem">
<Text text="Item 1"/>
<t:template>
<ComboBox id="DropDown"></ComboBox>
</t:template>
</t:Column>
<t:Column width="8rem">
<Text text="Item 2"/>
<t:template>
<ComboBox id="txt_itm2" ></ComboBox>
</t:template>
</t:Column>
<t:Column width="8rem">
<Text text="Item 3"/>
<t:template>
<ComboBox id="txt_itm3" ></ComboBox>
</t:template>
</t:Column>
</t:Table>









share|improve this question






























    1















    I have created a table with a drop down control. I am adding rows dynamically in my table. I am trying to bind my table column of drop down with a JSONModel but there are some challenges in there.



    var oTable = this.getView().byId("myTable");
    this.items.push(
    item1: "",
    item2: "",
    item3: ""
    );
    this.oModelJson.setData(this.items);
    this.oTable.setModel(this.oModelJson);
    this.oTable.bindRows("/");


    Now, my item1 is the drop down as declared in the view. After the end of above code, I am trying to bind my table drop down using following technique: my JSONModel is global and it has data. I am able to successfully bind my drop down outside of table but when I move my drop down inside the table, it is not binding.



    var oDDL = this.byId("DropDown");
    var oDDLTemplate = new sap.ui.core.Item(
    key: "key",
    text: "Text"
    );
    oDDL.setModel(this.oJson);
    oDDL.bindAggregation("items", "/results", oDDLTemplate);


    Here is my view, Table



    <t:Table id="myTable"
    width="auto"
    noDataText="No Record Found"
    busyIndicatorDelay="detailView>/lineItemTableDelay"
    class="sapUiResponsiveMargin"
    selectionMode="MultiToggle"
    visibleRowCount="5"
    >
    <t:extension>
    <l:HorizontalLayout>
    <Button icon="sap-icon://add" text="Row" press="addRow"/>
    <Button icon="sap-icon://delete" text="Row" press="fDeleteRow"/>
    </l:HorizontalLayout>
    </t:extension>
    <t:columns>
    <t:Column width="16rem">
    <Text text="Item 1"/>
    <t:template>
    <ComboBox id="DropDown"></ComboBox>
    </t:template>
    </t:Column>
    <t:Column width="8rem">
    <Text text="Item 2"/>
    <t:template>
    <ComboBox id="txt_itm2" ></ComboBox>
    </t:template>
    </t:Column>
    <t:Column width="8rem">
    <Text text="Item 3"/>
    <t:template>
    <ComboBox id="txt_itm3" ></ComboBox>
    </t:template>
    </t:Column>
    </t:Table>









    share|improve this question


























      1












      1








      1








      I have created a table with a drop down control. I am adding rows dynamically in my table. I am trying to bind my table column of drop down with a JSONModel but there are some challenges in there.



      var oTable = this.getView().byId("myTable");
      this.items.push(
      item1: "",
      item2: "",
      item3: ""
      );
      this.oModelJson.setData(this.items);
      this.oTable.setModel(this.oModelJson);
      this.oTable.bindRows("/");


      Now, my item1 is the drop down as declared in the view. After the end of above code, I am trying to bind my table drop down using following technique: my JSONModel is global and it has data. I am able to successfully bind my drop down outside of table but when I move my drop down inside the table, it is not binding.



      var oDDL = this.byId("DropDown");
      var oDDLTemplate = new sap.ui.core.Item(
      key: "key",
      text: "Text"
      );
      oDDL.setModel(this.oJson);
      oDDL.bindAggregation("items", "/results", oDDLTemplate);


      Here is my view, Table



      <t:Table id="myTable"
      width="auto"
      noDataText="No Record Found"
      busyIndicatorDelay="detailView>/lineItemTableDelay"
      class="sapUiResponsiveMargin"
      selectionMode="MultiToggle"
      visibleRowCount="5"
      >
      <t:extension>
      <l:HorizontalLayout>
      <Button icon="sap-icon://add" text="Row" press="addRow"/>
      <Button icon="sap-icon://delete" text="Row" press="fDeleteRow"/>
      </l:HorizontalLayout>
      </t:extension>
      <t:columns>
      <t:Column width="16rem">
      <Text text="Item 1"/>
      <t:template>
      <ComboBox id="DropDown"></ComboBox>
      </t:template>
      </t:Column>
      <t:Column width="8rem">
      <Text text="Item 2"/>
      <t:template>
      <ComboBox id="txt_itm2" ></ComboBox>
      </t:template>
      </t:Column>
      <t:Column width="8rem">
      <Text text="Item 3"/>
      <t:template>
      <ComboBox id="txt_itm3" ></ComboBox>
      </t:template>
      </t:Column>
      </t:Table>









      share|improve this question
















      I have created a table with a drop down control. I am adding rows dynamically in my table. I am trying to bind my table column of drop down with a JSONModel but there are some challenges in there.



      var oTable = this.getView().byId("myTable");
      this.items.push(
      item1: "",
      item2: "",
      item3: ""
      );
      this.oModelJson.setData(this.items);
      this.oTable.setModel(this.oModelJson);
      this.oTable.bindRows("/");


      Now, my item1 is the drop down as declared in the view. After the end of above code, I am trying to bind my table drop down using following technique: my JSONModel is global and it has data. I am able to successfully bind my drop down outside of table but when I move my drop down inside the table, it is not binding.



      var oDDL = this.byId("DropDown");
      var oDDLTemplate = new sap.ui.core.Item(
      key: "key",
      text: "Text"
      );
      oDDL.setModel(this.oJson);
      oDDL.bindAggregation("items", "/results", oDDLTemplate);


      Here is my view, Table



      <t:Table id="myTable"
      width="auto"
      noDataText="No Record Found"
      busyIndicatorDelay="detailView>/lineItemTableDelay"
      class="sapUiResponsiveMargin"
      selectionMode="MultiToggle"
      visibleRowCount="5"
      >
      <t:extension>
      <l:HorizontalLayout>
      <Button icon="sap-icon://add" text="Row" press="addRow"/>
      <Button icon="sap-icon://delete" text="Row" press="fDeleteRow"/>
      </l:HorizontalLayout>
      </t:extension>
      <t:columns>
      <t:Column width="16rem">
      <Text text="Item 1"/>
      <t:template>
      <ComboBox id="DropDown"></ComboBox>
      </t:template>
      </t:Column>
      <t:Column width="8rem">
      <Text text="Item 2"/>
      <t:template>
      <ComboBox id="txt_itm2" ></ComboBox>
      </t:template>
      </t:Column>
      <t:Column width="8rem">
      <Text text="Item 3"/>
      <t:template>
      <ComboBox id="txt_itm3" ></ComboBox>
      </t:template>
      </t:Column>
      </t:Table>






      sapui5






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 1 '18 at 12:27









      Boghyon Hoffmann

      7,19962862




      7,19962862










      asked Jan 30 '18 at 4:38









      H.KH.K

      72115




      72115






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Here is a minimal example: https://plnkr.co/edit/8YvXxk?p=preview



          In my example above, the rows are initially empty ([]). The binding definitions can stay in the view:



          <t:Table rows="/">
          <t:extension>
          <OverflowToolbar>
          <ToolbarSpacer />
          <Button
          icon="sap-icon://add"
          press=".onAddPress"
          />
          </OverflowToolbar>
          </t:extension>
          <t:columns>
          <t:Column>
          <Text text="Item 1" />
          <t:template>
          <ComboBox items="items1">
          <core:Item
          key="key"
          text="text"
          />
          </ComboBox>
          </t:template>
          </t:Column>
          <!-- ... -->
          </t:columns>
          </t:Table>


          By this, I just need to enhance the existing model data when the user presses on the + button instead of calling bindRows or bindAggregation every time.



          onAddPress: function() 
          const model = this.getOwnerComponent().getModel(); // JSONModel
          const currentRows = model.getProperty("/");
          const newRows = currentRows.concat(this.createEntry());
          model.setProperty("/", newRows);
          ,


          enter image description here






          share|improve this answer

























          • Hi, @BoghyonHoffmann, your sample seems to be working only with JSON model. Is it possible to use it with OData model?

            – zygimantus
            Nov 19 '18 at 9:31











          • @zygimantus The approach is the same; you're always adding a new object / entity to the model (instead of to the UI directly). In the case of ODataModel, the appropriate API is createEntry as mentioned in this answer: stackoverflow.com/a/48226884/5846045

            – Boghyon Hoffmann
            Nov 19 '18 at 10:05











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48513979%2fbind-a-drop-down-on-every-row-added-dynamically-on-sap-ui-table-table%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Here is a minimal example: https://plnkr.co/edit/8YvXxk?p=preview



          In my example above, the rows are initially empty ([]). The binding definitions can stay in the view:



          <t:Table rows="/">
          <t:extension>
          <OverflowToolbar>
          <ToolbarSpacer />
          <Button
          icon="sap-icon://add"
          press=".onAddPress"
          />
          </OverflowToolbar>
          </t:extension>
          <t:columns>
          <t:Column>
          <Text text="Item 1" />
          <t:template>
          <ComboBox items="items1">
          <core:Item
          key="key"
          text="text"
          />
          </ComboBox>
          </t:template>
          </t:Column>
          <!-- ... -->
          </t:columns>
          </t:Table>


          By this, I just need to enhance the existing model data when the user presses on the + button instead of calling bindRows or bindAggregation every time.



          onAddPress: function() 
          const model = this.getOwnerComponent().getModel(); // JSONModel
          const currentRows = model.getProperty("/");
          const newRows = currentRows.concat(this.createEntry());
          model.setProperty("/", newRows);
          ,


          enter image description here






          share|improve this answer

























          • Hi, @BoghyonHoffmann, your sample seems to be working only with JSON model. Is it possible to use it with OData model?

            – zygimantus
            Nov 19 '18 at 9:31











          • @zygimantus The approach is the same; you're always adding a new object / entity to the model (instead of to the UI directly). In the case of ODataModel, the appropriate API is createEntry as mentioned in this answer: stackoverflow.com/a/48226884/5846045

            – Boghyon Hoffmann
            Nov 19 '18 at 10:05















          2














          Here is a minimal example: https://plnkr.co/edit/8YvXxk?p=preview



          In my example above, the rows are initially empty ([]). The binding definitions can stay in the view:



          <t:Table rows="/">
          <t:extension>
          <OverflowToolbar>
          <ToolbarSpacer />
          <Button
          icon="sap-icon://add"
          press=".onAddPress"
          />
          </OverflowToolbar>
          </t:extension>
          <t:columns>
          <t:Column>
          <Text text="Item 1" />
          <t:template>
          <ComboBox items="items1">
          <core:Item
          key="key"
          text="text"
          />
          </ComboBox>
          </t:template>
          </t:Column>
          <!-- ... -->
          </t:columns>
          </t:Table>


          By this, I just need to enhance the existing model data when the user presses on the + button instead of calling bindRows or bindAggregation every time.



          onAddPress: function() 
          const model = this.getOwnerComponent().getModel(); // JSONModel
          const currentRows = model.getProperty("/");
          const newRows = currentRows.concat(this.createEntry());
          model.setProperty("/", newRows);
          ,


          enter image description here






          share|improve this answer

























          • Hi, @BoghyonHoffmann, your sample seems to be working only with JSON model. Is it possible to use it with OData model?

            – zygimantus
            Nov 19 '18 at 9:31











          • @zygimantus The approach is the same; you're always adding a new object / entity to the model (instead of to the UI directly). In the case of ODataModel, the appropriate API is createEntry as mentioned in this answer: stackoverflow.com/a/48226884/5846045

            – Boghyon Hoffmann
            Nov 19 '18 at 10:05













          2












          2








          2







          Here is a minimal example: https://plnkr.co/edit/8YvXxk?p=preview



          In my example above, the rows are initially empty ([]). The binding definitions can stay in the view:



          <t:Table rows="/">
          <t:extension>
          <OverflowToolbar>
          <ToolbarSpacer />
          <Button
          icon="sap-icon://add"
          press=".onAddPress"
          />
          </OverflowToolbar>
          </t:extension>
          <t:columns>
          <t:Column>
          <Text text="Item 1" />
          <t:template>
          <ComboBox items="items1">
          <core:Item
          key="key"
          text="text"
          />
          </ComboBox>
          </t:template>
          </t:Column>
          <!-- ... -->
          </t:columns>
          </t:Table>


          By this, I just need to enhance the existing model data when the user presses on the + button instead of calling bindRows or bindAggregation every time.



          onAddPress: function() 
          const model = this.getOwnerComponent().getModel(); // JSONModel
          const currentRows = model.getProperty("/");
          const newRows = currentRows.concat(this.createEntry());
          model.setProperty("/", newRows);
          ,


          enter image description here






          share|improve this answer















          Here is a minimal example: https://plnkr.co/edit/8YvXxk?p=preview



          In my example above, the rows are initially empty ([]). The binding definitions can stay in the view:



          <t:Table rows="/">
          <t:extension>
          <OverflowToolbar>
          <ToolbarSpacer />
          <Button
          icon="sap-icon://add"
          press=".onAddPress"
          />
          </OverflowToolbar>
          </t:extension>
          <t:columns>
          <t:Column>
          <Text text="Item 1" />
          <t:template>
          <ComboBox items="items1">
          <core:Item
          key="key"
          text="text"
          />
          </ComboBox>
          </t:template>
          </t:Column>
          <!-- ... -->
          </t:columns>
          </t:Table>


          By this, I just need to enhance the existing model data when the user presses on the + button instead of calling bindRows or bindAggregation every time.



          onAddPress: function() 
          const model = this.getOwnerComponent().getModel(); // JSONModel
          const currentRows = model.getProperty("/");
          const newRows = currentRows.concat(this.createEntry());
          model.setProperty("/", newRows);
          ,


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 18:15

























          answered Feb 1 '18 at 12:18









          Boghyon HoffmannBoghyon Hoffmann

          7,19962862




          7,19962862












          • Hi, @BoghyonHoffmann, your sample seems to be working only with JSON model. Is it possible to use it with OData model?

            – zygimantus
            Nov 19 '18 at 9:31











          • @zygimantus The approach is the same; you're always adding a new object / entity to the model (instead of to the UI directly). In the case of ODataModel, the appropriate API is createEntry as mentioned in this answer: stackoverflow.com/a/48226884/5846045

            – Boghyon Hoffmann
            Nov 19 '18 at 10:05

















          • Hi, @BoghyonHoffmann, your sample seems to be working only with JSON model. Is it possible to use it with OData model?

            – zygimantus
            Nov 19 '18 at 9:31











          • @zygimantus The approach is the same; you're always adding a new object / entity to the model (instead of to the UI directly). In the case of ODataModel, the appropriate API is createEntry as mentioned in this answer: stackoverflow.com/a/48226884/5846045

            – Boghyon Hoffmann
            Nov 19 '18 at 10:05
















          Hi, @BoghyonHoffmann, your sample seems to be working only with JSON model. Is it possible to use it with OData model?

          – zygimantus
          Nov 19 '18 at 9:31





          Hi, @BoghyonHoffmann, your sample seems to be working only with JSON model. Is it possible to use it with OData model?

          – zygimantus
          Nov 19 '18 at 9:31













          @zygimantus The approach is the same; you're always adding a new object / entity to the model (instead of to the UI directly). In the case of ODataModel, the appropriate API is createEntry as mentioned in this answer: stackoverflow.com/a/48226884/5846045

          – Boghyon Hoffmann
          Nov 19 '18 at 10:05





          @zygimantus The approach is the same; you're always adding a new object / entity to the model (instead of to the UI directly). In the case of ODataModel, the appropriate API is createEntry as mentioned in this answer: stackoverflow.com/a/48226884/5846045

          – Boghyon Hoffmann
          Nov 19 '18 at 10:05



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48513979%2fbind-a-drop-down-on-every-row-added-dynamically-on-sap-ui-table-table%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript