0
votes

I am displaying images in my page so i am using Image control

<m:Image src="{path: 'MyModel>Link', formatter:'.formatter.imageFormatter' }" visible= "true" alt="{i18n>picname}"></m:Image>

and the formatter

imageFormatter: function(val) {
        return val;
    },

when i see the network in the debbuger the image is loaded perfectlly with status 200 and when i see preview it is an empty image But in My page nothing is displayed (When i open the image in other tab when i go back to my app all images are displayed ) I Don't know the problem

2
Is this in Fiori Launchpad? - Marc
@Marc no standalone app - simon
Hi Simon - in order to help you will need to provide: the data model binding in the controller (since you get a 200 in the chrome debug tool this is likey an issue) and possible a bit more of the XML View. - Bernard
<m:Table items="{MyModel>/Images}" growing="true" growingScrollToLoad="true"> <m:headerToolbar> <m:OverflowToolbar></m:OverflowToolbar> </m:headerToolbar> <m:columns> <m:Column></m:Column> </m:columns> <m:ColumnListItem> <m:cells> <m:VBox> <m:VBox> <m:Image src="{path: 'MyModel>Link', formatter:'.formatter.imageFormatter' }" visible="true" alt="{i18n>picname}"></m:Image> </m:VBox> </m:VBox> </m:cells> </m:ColumnListItem> </m:Table> - simon
@Bernard am sure the binding is correct other properties are working only the images are not ( am getting the data from an odata) - simon

2 Answers

0
votes

Set the "densityAware" property to false in the sap.m.Image control and try again

0
votes

Simon. Set a value in the Column Header - e.g.: (please namespace correctly - you need to prefix with m:)

<Column 
    hAlign="Center"
    visible="true"
    width="145px">
    <Text text="Image"/>
</Column>

Not doing so may be having consequences you are not anticipating. Also, to me, your cells collection seems incorrect - can you try:

<m:items>
    <m:ColumnListItem type="Navigation" detailPress="onEdit">
        <m:cells>
            <m:Image src="{path: 'MyModel>Link', formatter:'.formatter.imageFormatter' }" visible="true" alt="{i18n>picname} />
       </m:cells> 
    </m:ColumnListItem>
</m:items>