on 08-22-2017 2:24 PM
We are using an oData model which is bound to the view. After the binding of the UI has taken place we are trying to update the binding of the model by doing: oModel.setProperty(). This change is not reflected in the UI. We have tried refreshing the list items and refreshing the model after the change, but both of these options call the backend (again) which degrades the performance.
I thought an update to the model should automatically update the control but it is not working in this case.
Hi Sarah,
Can you please share your view code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure - please see below. Also of note is the fact that this property doesn't exist initially, I create it when the user clicks on an item in the master list.
Here is the view with the icon being set to the Photo.
<m:ObjectListItem intro="{CandidateNeedStatusText}" title="{CandidateName}" icon="{Photo}" number="{ path: 'CandidateAvailabilityDate', type: 'sap.ui.model.type.Date', formatOptions: { style: 'medium' } }" numberUnit="Availability Date" numberState="None" type="Navigation" selected="false" showMarkers="false">
<m:attributes>
<m:ObjectAttribute title="" text="{CandidateJobTitle}" active="false"/>
</m:attributes>
<m:firstStatus>
<m:ObjectStatus state="Warning" icon="{path: 'IsCandidateLeadCaseInAnotherNeed', formatter: '.formatter.CandidateLeadCaseOtherNeedIcon'}" tooltip="This Candidate is the Lead Case in another Need. Please review other Needs this Canidate is being considered for."/>
</m:firstStatus>
<m:secondStatus>
<m:ObjectStatus text="" icon="{statusIcon}" />
</m:secondStatus>
</m:ObjectListItem>
Thank you Irfan! This will work!
Yes, it looks like this:
oModel.setProperty(aPaths[iIterator] + "/Photo", "sap-icon://person-placeholder");
After that line in the debugger I can check the model oData and the property is there. I have it bound in the view {Photo}.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
are you assigning the correct property like:
oModel.setProperty('/<property>', propertyValue);
?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.