Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Alert Boxes

what's the best way to have device independent alerts & confirms that don't use the 'Page @ Appery.io says:'.

I've looked at most of the jAlert implementations - and plugged some in - they're not very nice looking in the web-browser.... the Navigator functions don't work well or at all if you are testing from your desktop....

From experience --- what's the best 'replacement' for the alert() and confirm() functions - prior to publication ???

Thanks
Bruce

Alex GG
Posts: 0
Joined: Thu Nov 14, 2013 11:11 pm

Alert Boxes

Hi,
If you dont want to use the navigator functions, I recomend using the popups or dialogs.. like in this SS:

Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Alert Boxes

Bruce,

Could you please try using a pop-up component?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Alert Boxes

Evgene,

Thanks ... Can one popup be 'customized' to be used across multiple pages ? ( ie I define a popup and invest enough custom code to have it handle most alert & confirm situations... Can I re-use it anywhere in my app ? )

Thanks again,
Bruce

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Alert Boxes

Bruce,

No, unfortunately you can't create a custom pop-up. Instead of it, you may use a custom component for each pop-up you would like to look alike.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Alert Boxes

Evgene

Ok great. ... Next question then, if I have a popup that looks the same across 2 different pages .... Can I create one popup or so I need to create one popup per page ?

Bruce

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Alert Boxes

Hi Bruce,

You can create page template with needed popup and then use this this template to create pages you need. All these pages will have this popup.

See details about page templates here: http://devcenter.appery.io/documentat...

Regards

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Alert Boxes

Yurrii,

Thanks.... editorially it seems as though there ought to be a better way :-) ....but I'm sure there are larger fish to fry....

thanks for the quick answer....

Bruce

Louis
Posts: 0
Joined: Wed Nov 05, 2014 2:03 pm

Alert Boxes

Hi Bruce,

You can use the preinstalled native plugin called dialogs. It has built in alert, confirm, prompt or beep.
https://github.com/apache/cordova-plu...

This lets you use native pop/dialog function which is a big plus when it comes to trying to get on market stores (using native functions).

To make it work in a browser and devices not supported, I wrap try/catch statements to throw a normal alert.

It lets you also have a call back function for when they have closed the dialog.

Example:
code
try {
/* Call back function /
function alertDismissed() {
return false;
}
/ Dialog function */
navigator.notification.alert(
'This feature will be available soon!', // message
alertDismissed, // callback
'Coming Soon!', // title
'Done' // buttonName
);
} catch(err) {
alert("Error, this is in the works! Stay tuned!");
}
/code
ps: I wrapped in code tags but it's stripped formatting. Hopefully it makes sense to you :)

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Alert Boxes

Louis..... that's awesome --- thanks for the suggestion.... ! I'm going to take you up on using that ....

Return to “Issues”