WebView Source property binding to parent control's ItemsSource

DvckDvck ILMember ✭✭

I have a created a custom StackLayout where an ItemTemplate can be defined as well as an ItemsSource. I already used it multiple times in the past and I believe it works. I tried to make the ItemTemplate be a WebView that takes its' Source property value from an ObservableCollection of URL's by using Binding. The code:

<ContentPage.Content> <ScrollView> <custom:RepeatingStackLayout ItemsSource="{Binding ArticlesCollection}" Margin="5"> <custom:RepeatingStackLayout.ItemTemplate> <DataTemplate> <WebView Source="{Binding UrlAddress}" /> </DataTemplate> </custom:RepeatingStackLayout.ItemTemplate> </custom:RepeatingStackLayout> </ScrollView> </ContentPage.Content>

In the debug output I can see it's trying to contact the website as well as JavaScript files associated with it and more, however evantually, the website doesn't load and in the debug output it shows what I believe to be an error message:

[INFO:CONSOLE(1)] "Uncaught TypeError: e.data.indexOf is not a function", source: http://mobile.mako.co.il/news-israel/health/Article-f4cffa993c61c31004.htm (1)

09-07 08:22:40.185 I/chromium( 3112): [INFO:CONSOLE(1)] "Uncaught TypeError: e.data.indexOf is not a function", source: http://mobile.mako.co.il/news-israel/health/Article-f4cffa993c61c31004.htm (1)

I do want to point out that the website is online for sure, and also, when I created a page with just a WebView and set its' source to that website, it did work. Please help!

Sign In or Register to comment.