Use WebView with specific URL

34 views
Skip to first unread message

mar...@feldtmann.online

unread,
Nov 4, 2025, 8:37:49 AM (yesterday) Nov 4
to VAST Community Forum
Is there an example how to set a URL and navigate with the WebView widget after creation without any interaction. This seems to be a time critical issue. Doing it too early the widget is not ready. The example within VA simply works, because due to the kind of implementation it simply works, because any UI interaction gives the system enough time to work correctly.

Under C# it simply works :-)(

Marten

Johan Brichau

unread,
Nov 4, 2025, 10:33:39 AM (yesterday) Nov 4
to va-sma...@googlegroups.com
Hi Marten,

Please the example below on how to do this in VAST 14 (or earlier).

Indeed, the webview needs to be initialized before it can be interacted with. 
Because this happens asynchronously, one needs to wait a while, which comes ’naturally’ in the example that is provided in the documentation and code right now.
For the upcoming VAST 15, we have improved the WebView2 API such that the last 2 statements in this example can be replaced with `webView whenReadyDo: [ webView setUrl: 'https://www.instantiations.com/']`.

Hope this helps!

----
shell := CwTopLevelShell
    createApplicationShell: 'shell'
    argBlock: [:w | w title: 'Web View Demo'].

webView := CwWebView createWidget: 'WebView'
  parent: shell argBlock: [:w |  w
    borderWidth: 1;
    width: 1280;
    height: 1040 ].
webView manageChild.
shell realizeWidget. 

CwAppContext default readAndDispatchWhile:[ webView osWidget webView isNil ].

Johan Brichau

VAST Consultant
Senior Software Engineer

 jbri...@instantiations.com
 /johanbrichau
 instantiations.com
Twitter LinkedIn VAST Community Forum GitHub YouTube pub.dev

--
You received this message because you are subscribed to the Google Groups "VAST Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to va-smalltalk...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/va-smalltalk/b1a743fe-1c28-427f-84d4-2775b1d530d4n%40googlegroups.com.

mar...@feldtmann.online

unread,
Nov 4, 2025, 10:34:37 AM (yesterday) Nov 4
to VAST Community Forum
So, this kind of code seems the widget to work correctly:

[
| tmp |

tmp := PUMWebViewViewer new open.
tmp
editNavigateContents: 'https://www.spiegel.de' .
[ tmp webView osWidget webView isNil ] whileTrue: [  (Delay forMilliseconds: 100) wait  ].

tmp
navigate: nil clientData: nil callData: nil.
] fork

mar...@feldtmann.online

unread,
Nov 4, 2025, 10:36:05 AM (yesterday) Nov 4
to VAST Community Forum
Ah, ok ... I did not see your answer
Reply all
Reply to author
Forward
0 new messages