How to define User defined buttons in alert for Rhomobile Application

101 views Asked by At

I have been using WebView.execute_js() to popup some message or data as like below

WebView.execute_js("alert('"+message+"')")

But our client had specified to have custom buttons for the alert box. Do we have any way to make this success.

Please make some sample code, as i'm totally new to this framework.

Thanks

1

There are 1 answers

0
Ashis Kumar On BEST ANSWER

You can use Alert.show_popup() to accomplish this requirement.

Alert.show_popup( {
    :message => 'Some message', 
    :title => 'Custom title', 
    :icon => '/public/images/icon.png',
    :buttons => ["Yes", "No"] } )

Hope this helps you in brief http://docs.rhomobile.com/rhodes/device-caps#alerts