Welcome Guest Search | Active Topics | Sign In | Register

Error en Webview Options
Prequena84
Posted: Tuesday, April 26, 2022 8:34:09 AM
Rank: Advanced Member
Groups: Member

Joined: 5/10/2021
Posts: 43
Hello good morning, I am having a problem with a webview, I have developed a Script that allows me to access the elements of a product catalog of a website.

I'm trying to simulate a click to go to the next page within the same function in a webview, and I managed to create a loop that works fine, but when I try to click it doesn't update the webview until it finishes and exits the function that applies to that webview and gives an error that does not recognize an Evalscript that changes or modifies that same Webview, so the development solved it by clicking on the next page outside.

that is, create a loop with an example

for i = 1 to xxx

JS_Download_Data = "xxxxx

my functions

xxxxx

me.webview1.Evalscript(JS_Download_Data)

next


but it is not the best way the idea is to make that click and change the page in the same function with a Witch or For bubble in the JavaScript, otherwise I will need an update with the solution of this error, or unless you give me one idea how to solve this idea better, thank you very much in advance.
eo_support
Posted: Tuesday, April 26, 2022 11:31:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

You would have to do it this way. This is because many tasks in the browser engine won't have a chance to run until your code exits. So the basic flow is:

1. You request the browser to do something;
2. The browser engine does the work;
3. You check the result;

Step 1 and step 3 CAN NOT be together in your case. This is like a conversation between two persons. You have to yield so that the other person can respond.

Note that this rule is not absolute and only SOME tasks requires you to relinquish control first. Loading a page is one of them. So you must relinquish control after you initiate the action (clicking next page) in order for the action to be fully carried out.

Thanks!
Prequena84
Posted: Tuesday, April 26, 2022 12:01:20 PM
Rank: Advanced Member
Groups: Member

Joined: 5/10/2021
Posts: 43
It is clearer to me, in short, if I work with 2 browsers where 1 makes the request, the 2nd works the browser engine and downloads the data and the 1st clicks again on the next page and so on, I would not have problems with this conflict?

Since I'm working with the function extensions and so far it works very well and stable, I'm going to try it this way so that how it works for me and if I have any questions, I'll let you know, since there are some details that I'm still learning.

Thank you very much.
eo_support
Posted: Wednesday, April 27, 2022 6:05:29 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

It doesn't matter how many WebView object you use. If you have a single UI thread, then that UI thread must yield in order for certain task for any WebView to proceed.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.