I'm trying to simple navigation. And I tried more than one way to open another screen.
- Hide/show concept (But It's working only single File).
- Using View Stack (But Still Not Working)
- Using tag and inside the tag to call another file. (But Its error has given Interface not a member of BrightScript Component)
- Using the same tag and inside the tag to call another file. (But It does not fetch the value from another file).
Here My First File Write a code to First Screen
Main.brs
screen = CreateObject("roSGScreen") 'one Application only once roSGScreen
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("WisePanel") 'Here the First screen component name
screen.show()
PanelSet.xml
<?xml version="1.0" encoding="UTF-8"?>
<component name="WisePanel" extends="Scene">
<script type="text/brightscript" uri="pkg:/components/PanelSet.brs" />
<Group id="FirstScreen" >
<Label
id = "lbfirstscreen"
font="font:LargeBoldSystemFont"
text = "This is the first Screen"
translation = "[200,250]" />
</Group>
</component>
Here the .brs file in the key event set to open another screen(click option key and open a new screen)
PanelSet.brs
sub init()
m.FirstScreenLabel = m.top.findNode("lbfirstscreen")
end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
handled = false
if press then
if key="options" then
' Here the write a Logic
keyboard= CreateObject("roSGNode", "KeyboardDialog")
?"call keyevent Fucntion"
'here show function to give a error
m.top.ComponentController.CallFunc("show", {
view: keyboard
})
end if
end if
end function
My second screen XML and brs both in single file File is
keyboarddialogscene.xml
<?xml version = "1.0" encoding = "utf-8" ?>
<component name = "KeyboardDialog" extends = "Group" >
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.SecondScreenLabel = m.top.findNode("lblsecondscreen")
end sub
]]>
</script>
<children >
<Group id="SecondScreen" >
<Label
id = "lblsecondscreen"
font="font:LargeBoldSystemFont"
text = "This is the second Screen"
translation = "[200,250]" />
</Group>
</children>
</component>
I try to Click in Remote Option key then I display a Label on second screen File anyone knows the issue.