Try like this,
dataPopProps = Hash.new
dataPopProps['message'] = "Fetching Data...";
dataPopProps['title'] = "Please Wait";
dataPopProps['buttons'] = ["Ok"]
Rho::Notification.showPopup(dataPopProps)
Question
I am trying to migrate my rho application from 3.1 to 4.0. In 3.1 i have defined alert using Alert.show_popup :title => "Please Wait", :message => "Fetching Data..."
But as specified in documentation now i have changed it to the
dataPopProps = Hash.new
dataPopProps['message'] = "Fetching Data...";
dataPopProps['title'] = "Please Wait";
Rho::Notification.showPopup(dataPopProps)
But i am still getting the same error. Error: Button list has been incorrectly defined. DIalog will not Launch
Any help will be great.
Solution
Try like this,
dataPopProps = Hash.new
dataPopProps['message'] = "Fetching Data...";
dataPopProps['title'] = "Please Wait";
dataPopProps['buttons'] = ["Ok"]
Rho::Notification.showPopup(dataPopProps)
OTHER TIPS
For future reference, the official docs are often incorrect, so working with Rhodes can be frustrating. However, the example listed here seems to be a good solution. Note that the example for Notification is in Javascript.
Here is an elegant way to write this in Ruby:
dataPopProps = {
'message' => 'Fetching Data...',
'title' => 'Please Wait',
'buttons' => [{ :id => 'no', :title => 'no' }]
}
Semicolons are eggregiously unecessary in Ruby, and you can clean up your code by using literals instead of Hash.new
.