Forum Discussion

maihde's avatar
maihde
Visitor
15 years ago

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.

5 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert
    Try adding:
    screen.SetStaticRatingEnabled(false)

    -JT
  • 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.
  • "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.
  • 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!
  • renojim's avatar
    renojim
    Community Streaming Expert
    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