Skip to content

Conversation

@marekpelc-pega
Copy link
Contributor

@marekpelc-pega marekpelc-pega commented Dec 11, 2025

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

@marekpelc-pega marekpelc-pega requested a review from a team as a code owner December 11, 2025 10:39
@marekpelc-pega marekpelc-pega changed the title ISSUE-138440: changes to enable calling ActionButtons event from ListViewComponent ISSUE-138440: [DO NOT MERGE YET] changes to enable calling ActionButtons event from ListViewComponent Dec 11, 2025
@marekpelc-pega
Copy link
Contributor Author

attaching diff of changed ListViewComponent and ListViewRenderer so that autosubmit is performed after choosing option
listviewAutosubmit.txt

@marekpelc-pega marekpelc-pega changed the title ISSUE-138440: [DO NOT MERGE YET] changes to enable calling ActionButtons event from ListViewComponent ISSUE-138440: changes to enable calling ActionButtons event from ListViewComponent Dec 11, 2025
@marekpelc-pega marekpelc-pega force-pushed the feature/pelcm/ISSUE-138440 branch from f9d3098 to c8c0a46 Compare December 11, 2025 12:17
@marekpelc-pega marekpelc-pega force-pushed the feature/pelcm/ISSUE-138440 branch from c8c0a46 to 3b1940a Compare December 11, 2025 12:29

class AndroidWebViewEngine(
private val context: Context,
private val lifecycleScope: CoroutineScope,
Copy link
Contributor

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)
Copy link
Contributor

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

Copy link
Contributor

@lukaszgajewski-pega lukaszgajewski-pega left a 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
@marekpelc-pega marekpelc-pega force-pushed the feature/pelcm/ISSUE-138440 branch from 2dbbc23 to 0034d6b Compare December 11, 2025 13:34
@marekpelc-pega marekpelc-pega merged commit 6f965a9 into master Dec 12, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants