Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
devCodezyng
Reel Rookie

How to add search button to my roku channel

im trying to add search button to my channel which can search all the content in my show how to do that? How to create a splash screen like youtube has ?

0 Kudos
11 REPLIES 11
Uzair_Abdullah
Streaming Star

Re: How to add search button to my roku channel

Hello! Have you written the search functionality? A search function? If so, it is as simple as adding a button in your XML file and the BrightScript file, observing the field and adding the function. Like so, in XML:

<children>
  <Button 
      id="searchButton" 
      text = "Search Button"
      showFocusFootprint = "true"
 />
</children>

  Now BrightScript brs file:

sub init()
  m.searchButton = m.top.findNode("searchButton")
  m.searchButton.observeField("buttonSelected","searchFunction")
end sub

function searchFunction()
  //your code and logic
end function

Further reading, Roku docs for button: https://developer.roku.com/en-gb/docs/references/scenegraph/widget-nodes/button.md 

I hope this helps!

devCodezyng
Reel Rookie

Re: How to add search button to my roku channel

thank you so much i was a little lost.

Uzair_Abdullah
Streaming Star

Re: How to add search button to my roku channel

Glad to know it helped!

0 Kudos
silentEngineer
Channel Surfer

Re: How to add search button to my roku channel

so i added a function that opens a keyboard when i click the search button but if i keep clicking down button the focus goes out of the keyboard and onto the grid screen. If i keep clicking left it loops through to the other side. How to do that for up and down also?

0 Kudos
Uzair_Abdullah
Streaming Star

Re: How to add search button to my roku channel

Your question would be more clear if you also posted a screenshot of your UI. Then rephrase your question, thanks.

0 Kudos
silentEngineer
Channel Surfer

Re: How to add search button to my roku channel

I have created a search button that when clicked opens  a keyboard. When i reach the bottom edge of the keyboard and press down the focus goes out of the keyboard onto the previous page. If i press down after this it goes out of keyboard focus.IMG_20230720_095215016.jpg

0 Kudos
Uzair_Abdullah
Streaming Star

Re: How to add search button to my roku channel

The keyboard focus doesn't fall out unless there is another focusable element. Check your XML if you haven't accidentally added another focusable node. As for the part if it goes back to the previous screen, I don't understand, how does it do that?

 

0 Kudos
silentEngineer
Channel Surfer

Re: How to add search button to my roku channel

i rendered the keyboard over the grid screen. I think im missing something. Do you have a sample for search in roku channel?

0 Kudos
Uzair_Abdullah
Streaming Star

Re: How to add search button to my roku channel

unfortunately, no. I haven't worked on search.

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.