Forum Stats

  • 3,876,212 Users
  • 2,267,082 Discussions
  • 7,912,473 Comments

Discussions

Source tag in image component not working in iOS devices

Siddharth Chopra
Siddharth Chopra Member Posts: 47
edited Aug 28, 2014 2:09AM in Mobile Application Framework

Hello,

I want to set image url in source tag of image component. Currently i am using JDeveloper 12c(12.1.3.0).

Its working fine in Android Devices but not working in iOS Devices.

Below is my amx page code:

                       <amx:listView var="row" value="#{bindings.youtubeFeeds.collectionModel}"

                                  fetchSize="#{bindings.youtubeFeeds.rangeSize}"

                                  selectedRowKeys="#{bindings.youtubeFeeds.collectionModel.selectedRow}"

                                  selectionListener="#{bindings.youtubeFeeds.collectionModel.makeCurrent}"

                                  showMoreStrategy="autoScroll" bufferStrategy="viewport" id="lv2"

                                  inlineStyle="background-color:rgba(0,0,0,0.3); margin-bottom:10%;">

                        <amx:listItem id="li2">

                            <amx:panelGroupLayout id="pgl5"

                                                  inlineStyle="margin:0;  padding:4%; padding-top:2%; padding-bottom:2%;">

                                <amx:tableLayout id="tl3" width="100%" inlineStyle="width:100%;">

                                    <amx:rowLayout id="rl3">

                                        <amx:cellFormat halign="center" id="cf3" valign="middle"

                                                        inlineStyle="width:45%;">

                                            <amx:image source="#{row.thumbURL}" id="i5" inlineStyle="width:100%;"/>

                                        </amx:cellFormat>

                                    </amx:rowLayout>

                                </amx:tableLayout>  

                            </amx:panelGroupLayout>

                        </amx:listItem>

                    </amx:listView>

I have also tried with setting static url from java code

           youtubeFeeds.setThumbURL("http://iconbug.com/data/9f/507/7539a8d9ee940f052a34a4eaae4775a1.png");

and through binding, i have shown that in listView component. But same issue not working in iOS Devices.


Yes, its working fine. This image is there in a image folder in a project itself.

          <amx:image id="i121" source="/images/bg.jpg" inlineStyle="width:100%; height:100%;"/>


Same thing i want to do this image url.

Any help will be appreciated.


Regards,

Siddharth


Tagged:

Best Answer

  • Deepak-Jain
    Deepak-Jain Member Posts: 510
    Answer ✓

    a. Can you see that image in preview mode if you hardcode that url in amx?

    b. Can you try adding *.iconbug.* in whitelist and try. (You can do it maf-application.xml -> Security -> Remote URL Whitelist)

    Regards,

    Deepak

Answers

  • Deepak-Jain
    Deepak-Jain Member Posts: 510
    Answer ✓

    a. Can you see that image in preview mode if you hardcode that url in amx?

    b. Can you try adding *.iconbug.* in whitelist and try. (You can do it maf-application.xml -> Security -> Remote URL Whitelist)

    Regards,

    Deepak

  • User_HWHT9
    User_HWHT9 Member Posts: 2,858 Employee

    Actually I believe there is a bug here, I think the image should not display on iOS *and* Android unless you specify the URL in the maf-application.xml whitelist.  So the image not displaying on iOS is the expected behaviour, and Android is incorrect in this case as it should also not show the image until you add that whitelist entry.

    For your immediate problem, include "iconbug.com" in the whitelist.

    Can you tell me, regardless of the whitelist entry for iOS, on Android does the image appear on the Android Emulator for you?  I don't have an Android device handy, and regardless of the whitelist entry the image doesn't display at all on the Android Emulator.

    Mind you, it's a bit unusual displaying remote images in your AMX page, this would imply your application must always be online.  Is this your intention?

    CM.

  • Deepak-Jain
    Deepak-Jain Member Posts: 510

    Hi CM,

    I have tried this in Android Emulator and Android Device and I can see the image getting displayed without even adding it to whitelist.

    Hi Siddharth,

    Also, using remote urls for displaying image will have a performance impact but could be useful if you want to keep changing it.

    Regards,

    Deepak

  • Frank Nimphius-Oracle
    Frank Nimphius-Oracle Member Posts: 29,689 Bronze Badge

    Hi,

    can you add an output text component next to the image to see that the image URL is coming okay?

    <amx:image source="#{row.thumbURL}" id="i5" inlineStyle="width:100%;"/>

    <amx:outputText value="#{row.thumbURL}" ot="i5"/>


    Have you tried one of the image URLs on the iOS browser to ensure your iOS device has access? I think that we first need to ensure that the files are accessible.


    Frank