0

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 Shown on mobile Error: Button list has been incorrectly defined. DIalog will not Launch

Any help will be great.

Aks
  • 1,567
  • 13
  • 23

2 Answers2

1

Try like this,

 dataPopProps = Hash.new    
 dataPopProps['message'] = "Fetching Data...";
 dataPopProps['title'] = "Please Wait";    
 dataPopProps['buttons'] = ["Ok"]
 Rho::Notification.showPopup(dataPopProps)
visnu
  • 935
  • 6
  • 16
1

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.

Steve Benner
  • 1,679
  • 22
  • 26