单击按钮不触发单击事件以及如何在 ROKU 中导航另一个面板

Click button not fire a click Event and how to navigate another panel in ROKU

我在 Roku 中创建了登录面板。在登录时,我单击确定按钮可以导航到另一个面板。

我创建了一个登录面板,其中使用了两个文本框,一个用于用户名,另一个用于密码,还有两个按钮,一个用于登录,另一个用于取消。问题是我单击了登录按钮但没有单击事件触发

我在onkeyevent中使用按钮组和下面的代码

if m.btngrp.buttonSelected = 0 then 
      if key = "OK"
            ? "print the sign-in button"
      end if
else if m.btngrp.buttonSelected = 1 then
      if key = "OK"
            ? "print the setting button"
      end if            
else 
      ? "nothing press"
end if

请任何发现这些问题的人帮助我。

我假设您已经在 Button Group 组件中设置了观察者:

m.btngrp.observeField("buttonSelected", "onButtonSelected")

然后,在回调中你应该有:

function onButtonSelected()
    if m.btngrp.buttonSelected = 0 then 
         ? "print the sign-in button"
    else if m.btngrp.buttonSelected = 1 then
         ? "print the setting button"
    end if
end function