-
Notifications
You must be signed in to change notification settings - Fork 3
ISSUE-138440: changes to enable calling ActionButtons event from ListViewComponent #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ine.kt on main thread using activity lifecycleScope
|
attaching diff of changed ListViewComponent and ListViewRenderer so that autosubmit is performed after choosing option |
f9d3098 to
c8c0a46
Compare
c8c0a46 to
3b1940a
Compare
|
|
||
| class AndroidWebViewEngine( | ||
| private val context: Context, | ||
| private val lifecycleScope: CoroutineScope, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this not necessarily must be lifecycleScope. Pega form can be shown anywhere, even in a very small piece of the native client app and it should be tied with that. I would rather rename it to be more generic: scope: CoroutineScope
| val script = "window.sendEventToComponent('${id.id}', '$eventJson')" | ||
| webView.evaluateJavascript(script, null) | ||
| this.lifecycleScope.launch { | ||
| webView.evaluateJavascript(script, null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If evaluateJavascript must be called on Main thread, then switch contexts here. You can even use Main.immediate dispatcher
lukaszgajewski-pega
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at above comments:
- change prop name
- switch context to Main.immediate, do not depend on the scope injected
…constructor launch evaluateJavascript with Dispatchers.Main.immediate
2dbbc23 to
0034d6b
Compare
This solution does not add automatic submit feature for ListViewComponent but enables to do it with custom code in ListViewComponent and ListViewComponentRenderer
Attaching diff of changed ListViewComponent and ListViewRenderer so that autosubmit is performed after choosing option
listviewAutosubmit.txt