<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Two-Way Binding with createEntry SAPUI5 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658810#M4356391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when you call &lt;/P&gt;&lt;OL class="dp-c" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #5c5c5c; margin: 0 0 1px 45px !important; background: #ffffff;"&gt;&lt;LI&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-family: helvetica, arial; font-weight: inherit; background-position: initial;"&gt;oView.getModel().setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);&amp;nbsp; ? before setting binding context?or after?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Apr 2016 13:45:10 GMT</pubDate>
    <dc:creator>junwu</dc:creator>
    <dc:date>2016-04-25T13:45:10Z</dc:date>
    <item>
      <title>Two-Way Binding with createEntry SAPUI5</title>
      <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaq-p/11658807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use Two-Way binding with a v2 OData model. In the route matched of the create view I have the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;this.getOwnerComponent().oWhenMetadataIsLoaded.then(function() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var oEntry = oView.getModel().createEntry("/ContactCollection");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; oView.setBindingContext(oEntry);&lt;/P&gt;
&lt;P&gt;}.bind(this));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }.bind(this));&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;At runtime i call the screen and update a value in the create view that is "bound" to the model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in my save function I have been executing the following line in the debugger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;this.getView().getBindingContext().getObject()&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output is a blank entity will all properties set to "undefined".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While searching I found this &lt;A href="https://help.sap.com/saphelp_nw74/helpdata/en/91/f191d26f4d1014b6dd926db0e91070/content.htm"&gt;page&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i implemented line &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;oView.getModel().setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in the route matched function above with same results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;oView.unbindElement();&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;from the discussion &lt;A href="https://github.com/SAP/openui5/issues/377"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Apr 2016 13:24:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaq-p/11658807</guid>
      <dc:creator>former_member254939</dc:creator>
      <dc:date>2016-04-24T13:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Two-Way Binding with createEntry SAPUI5</title>
      <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658808#M4356389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how you store the model? with name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 04:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658808#M4356389</guid>
      <dc:creator>junwu</dc:creator>
      <dc:date>2016-04-25T04:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Two-Way Binding with createEntry SAPUI5</title>
      <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658809#M4356390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an unnamed model so my binding looks like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;value="{path :'firstName',type: 'sap.ui.model.odata.type.String'}"&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 12:16:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658809#M4356390</guid>
      <dc:creator>former_member254939</dc:creator>
      <dc:date>2016-04-25T12:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Two-Way Binding with createEntry SAPUI5</title>
      <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658810#M4356391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when you call &lt;/P&gt;&lt;OL class="dp-c" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #5c5c5c; margin: 0 0 1px 45px !important; background: #ffffff;"&gt;&lt;LI&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-family: helvetica, arial; font-weight: inherit; background-position: initial;"&gt;oView.getModel().setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);&amp;nbsp; ? before setting binding context?or after?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 13:45:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658810#M4356391</guid>
      <dc:creator>junwu</dc:creator>
      <dc:date>2016-04-25T13:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Two-Way Binding with createEntry SAPUI5</title>
      <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658811#M4356392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL class="dp-c" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #5c5c5c; margin: 0 0 1px 45px !important; background: #ffffff;"&gt;&lt;LI&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-family: helvetica, arial; font-weight: inherit; background-position: initial;"&gt;oView.getModel().setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-family: helvetica, arial; font-weight: inherit; background-position: initial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-family: helvetica, arial; font-weight: inherit; background-position: initial;"&gt;Did you try setting the model's default binding mode when it was created instead of in the view?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-family: helvetica, arial; font-weight: inherit; background-position: initial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 13:54:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658811#M4356392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-04-25T13:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Two-Way Binding with createEntry SAPUI5</title>
      <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658812#M4356393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did. When I tried it it looked like.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;this.getOwnerComponent().oWhenMetadataIsLoaded.then(function() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; oView.getModel().setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var oEntry = oView.getModel().createEntry("ContactCollection");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; oView.setBindingContext(oEntry);&lt;/P&gt;
&lt;P&gt; });&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }.bind(this));&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But still did not work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 14:09:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658812#M4356393</guid>
      <dc:creator>former_member254939</dc:creator>
      <dc:date>2016-04-25T14:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Two-Way Binding with createEntry SAPUI5</title>
      <link>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658813#M4356394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked. I passed in the default binding mode on create to be set to TwoWay using the documentation found &lt;A href="https://sapui5.hana.ondemand.com/sdk/#docs/api/symbols/sap.ui.model.odata.v2.ODataModel.html#constructor"&gt;here&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why the function call did not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 14:11:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/two-way-binding-with-createentry-sapui5/qaa-p/11658813#M4356394</guid>
      <dc:creator>former_member254939</dc:creator>
      <dc:date>2016-04-25T14:11:52Z</dc:date>
    </item>
  </channel>
</rss>

