I just wonder how to do some events with Javascript Apache Cordova project on Visual Studio
Do i need to create new js file for each html file (like Controller - View on MVC)
What is the events fire sort ? (Which event first, which event next firing )
I do same sample, i put one button and when i click button i open new page, when i fire backbutton, first page comes, but button on the first page not working anymore, what is wrong ?
And at last, how can store some data on SQLite database localy and do some read,write,list actions ? Is there any sample code with these ?
Thanks everybody,
Do i need to create new js file for each html file (like Controller - View on MVC).
It's not necessary, you can put all code to one .js file. Depends on your coding style and used framework.
What is the events fire sort ? (Which event first, which event next firing ).
Cordova app, in fact, is a web page in mobile browser. So you should read proper docs. For special Cordova events see this page: http://cordova.apache.org/docs/en/4.0.0/cordova_events_events.md.html#Events
I do same sample, i put one button .....
First af all, it's recommended to use Single-Page-Application, for details see there: http://cordova.apache.org/docs/en/4.0.0/guide_next_index.md.html#Best%20Practices. As for your app, you shoukd provide some more details. Looks, like you missed some script or link while reloading first page.
how can store some data on SQLite database localy
First, read this page about storage: http://cordova.apache.org/docs/en/4.0.0/cordova_storage_storage.md.html#Storage. It's recommended to use WebSQL, but you can try this plugin: https://github.com/brodysoft/Cordova-SQLitePlugin, or read this article about WebSQL: http://msopentech.com/blog/2014/05/05/websql-plugin-for-apache-cordova/
Related
hi i wanna have a filter pre every web pages that check someting and if that thing was incorrect show me an error page
and if it was fine just show me the page
Vaadin is mostly based on individual interactions such as clicking buttons or scrolling in a grid, rather than viewing pages. What you can still do is to use UI::addBeforeEnterListener to get an event before navigating to a new target. You can use a VaadinServiceInitListener to register that listener for all your UI instances.
For more information, have a look at this blog post that I've written on the topic.
I am trying to merge surveyjs along with my NativeScript application. I have referred URL for merging the same with Angular application
From the Angular demo code given on website, we have to add event handler for Complete button where we can get the response from surveyjs. Is it possible to integrate similarly for Nativescript Mobile application? Here is the approach which i feel can be taken.
Display
Create a HTML as provided by SurveyJS with required CSS and JS
referenced and add them as a file in project.
Modify HTML once i get the survey question json back from server.
Show the HTML as part of WebView. This will take care of displaying
the survey on my Application.
Here are my challenges during Submission
As per the process given on SurveyJS, i need to add handler for
oncomplete which will get the result json for me. How can i add
handlers for Complete button click in my code? Also please note that
there is a possibility that there may be multiple surveys on a single
page.
Apart from Survey, there are other fields also on the page and user
will submit them all in one go by clicking submit button of the page.
Hence i am planning to hide Complete button provided by SurveyJS
page. This needs to be triggered via code. Can this be done?
If someone can give directions on whether this scenario can be handled in nativescript application with Angular,it would help immensely.
yes it can be done using nativescript-webview-interface plugin.
add jS code inside WebView to handle oncomplete event from surveyJS. and on that function call emit some event to native app. after that add nativescript code to listen for that event and get the JSON back.
inside webView JS function
var oWebViewInterface = window.nsWebViewInterface;
// emit event to native app
oWebViewInterface.emit('anyEvent', jsonData);
inside native App
oWebViewInterface.on('anyEvent', function(jsonData){
// perform action on event
});
for more details on this you can check plugin readme file https://github.com/shripalsoni04/nativescript-webview-interface
I'm building an Ionic application, I have built 50% of the project, and at first I used the sidemenu template that is auto generated with ionic start MyProject sidemenu, and then I added my own pages and components after that.
In the browser view the app was great, then I deployed my application to an android device, with the deployment being successfully When I start the application I felt that the application was slow, but when I switch to a some view, it took 5-10 seconds to open the new page.
I watched the traffic between the server side and the application, and observed that the application is not switching to the new page until the request is back and the view is rendered!
any help?
Try switching to your views first and then using the ionViewWillEnter() or another built in ionic API for the application lifecycle.
ionViewWillEnter will pull the data everytime the view loads, where
ionViewDidLoad will pull the page on first load only.
ionViewDidLoad() {
console.log('ionViewDidLoad SplashPage');
}
You do not state which version of ionic you are using but in ionic 3 if you create your pages with the terminal using
ionic g page MyPage
It will automatically create the page as a module. This allows for lazy loading. You can read more on it here form ionic's official blog post.
Its hard to say exactly why the view is only loading after it hits the server as you have not added your navigational code. There could be a code block that waits for a server response before pushing to the next page.
If your view is depended on received data from the server then your request should be in a new Promise allowing you to add conditionals for before and/or after the data has been touched.
As per my project requirement i want to develop an Ajax application with GWT Ui-Binder.. for achieving page refreshing automatically while getting content from database..
Remember: withOut click Refresh button (or) any mouse motion.If u aware about this task...can you please give me with any related exmaple..
if you want to refresh automatic, so you may have any condition where you get event of getting data from database like rpc came on success method etc.. then simply call Window.Location.refresh(); there.
I thought I would ask here about how to develop a wiazrd like control
in ajax for MVC before I started it.
The control will have pages that have data entry controls and
on each page submission insert data into a database.
Any ideas how to go about this?
Malcolm
Are you using a JavaScript library? I know dojo has a wizard in dojox namespace, and I'm pretty sure there are wizards for jquery. If not, I'd do a wizard just like I would tabs, without the tab bar, and each view contains a form and next, previous, cancel and or restart buttons, all of which would handle the ajax calls/state management and change the view.
If it's a wizard you probably actually should use separate web pages rather than having a single page that's updated through ajax calls, that way the forward and back buttons can work as nature intended in the browser for moving forward and back through the wizard.
Of course you can use fragment tricks to get forward / back working in a single page but in my experience this is tricky.