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: 
maihde
Visitor

roMessageDialog AddRatingButton doesn't send events

I'm trying to display an roMessageDialog that shows a rating button; however, when I do this changes to the rating do not trigger any events. Other buttons in the dialog do trigger events. Here is a snippet of what I'm trying to accomplish


port = CreateObject("roMessagePort")
screen = CreateObject("roMessageDialog")
screen.SetMessagePort(port)
screen.EnableOverlay(true)
screen.SetMenuTopLeft(true)
screen.SetTitle("Change Rating")
screen.SetText("Some text")

screen.AddRatingButton(1, userRating, aggregateRating, "therating") ' this doesn't trigger a msg
screen.AddButton(2, "Btn2") ' triggers a msg
screen.AddButton(3, "Btn3") ' triggers a msg
screen.EnableBackButton(true)
screen.Show()

while true
msg = wait(0, port)
if msg <> invalid then
print type(msg); " "; msg.getIndex(); " "; msg.getData()
end if
end while


Any thoughts about why the rating button is not triggering a message? I'm currently on firmware version 3.0 build 2227.
0 Kudos
5 REPLIES 5
renojim
Community Streaming Expert

Re: roMessageDialog AddRatingButton doesn't send events

Try adding:
screen.SetStaticRatingEnabled(false)

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
maihde
Visitor

Re: roMessageDialog AddRatingButton doesn't send events

The SetStaticRatingEnabled isn't part of the ifMessageDialog interface, but I tried it anyways and here is the error message


Member function not found in BrightScript Component or interface. (runtime error &hf4) in ...
264: screen.SetStaticRatingEnabled(false)


The rating button works fine in roSpringBoard with or without the static rating enabled.
0 Kudos
gonzotek
Visitor

Re: roMessageDialog AddRatingButton doesn't send events

"maihde" wrote:
The SetStaticRatingEnabled isn't part of the ifMessageDialog interface, but I tried it anyways and here is the error message


Member function not found in BrightScript Component or interface. (runtime error &hf4) in ...
264: screen.SetStaticRatingEnabled(false)


The rating button works fine in roSpringBoard with or without the static rating enabled.

It sounds like a firmware bug, or bad documentation. From the beta 3.0 sdk Compenent Reference, under 4.10 roMessageDialog:
Boolean AddRatingButton(Integer id, Integer userRating,
Integer aggregateRating, String tip)
 Adds a star rating button to the dialog. The rating is specified as a string whose value is an integer 1-100 which indicates the number of stars (1 to 5) to be displayed. Think of this as a percentage value <20% = 1 star. This button is displayed in the menu area of the screen and appears in the order added. The userRating specifies the value the user rated the title, while the aggregate Rating represents the total for all users. The userRating takes precedence and determines the color of the buttons if set. The aggregateRating may display half-stars. The button returns the userRating in the event data field.
 The rating widget is only allowed on message dialogs that call SetMenuTopLeft(true).
So your code appears correct and the button should be triggering an event, but isn't.
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
maihde
Visitor

Re: roMessageDialog AddRatingButton doesn't send events

Yeah, I was expecting that to be the case 😞

I was hoping that there would be some clever workaround...oh well, I will switch to a springboard instead.

Thanks for the help!
0 Kudos
renojim
Community Streaming Expert

Re: roMessageDialog AddRatingButton doesn't send events

Sorry, I missed the part about it being a message dialog.

It looks like it's another bug in v3.0 b2227. It works in v4 of the firmware.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos