Posts by DecSoft

Show threads by DecSoft
3352 posts found, page 219 of 224

DecSoft (In thread: NeoPlugins - Parsing an HTML table)

Hello Nelson,

Probably npXmls can do the job too, but I think npRexp can be better here. I modified one of the npRexp samples in order to search for "pcom" data in your HTML table. Take a look if you wanted here:

Sample download

I just modified a little the application sample, then probably we can get better results: it's a question of time, some npRexp study and adapt the plugin to our own publication.


DecSoft (In thread: load array with LoadVariables action ?)

Hello Walter,

Various things to consider here.

4. If I change something in these files IE accepts it immediatly, Chrome and Firefox donn´t . although I pressed F5 different times and I empty the cache manually ...

I test right now in Internet Explorer, Firefox and Chrome and works like expected. If I load a file with two variables "a" and "b" I can use "LoadVariables" or "ParseVariables" and then access such variables. If then I change the file and add a new "c" variable, when I use again the refered actions, there is no problem to get the value of the new added variable.

If we are talking of files included by the app, remember that you can edit the original file, but the app have their own copy of the file! If the argument for the "LoadVariable" action is an remote URL (a remote file) then this must work like expected if you edit the remote file, however, remember "LoadVariables" is not the best way load remote files, because we have no feedback.

"LoadVariables" is mainly intended to load variables for an HTML template, that is, the content of an HTML control. We can use in other scenarios too (for my above test I did so) but it's not recomended, since "LoadVariables" do not offer any feedback about their success or error. This action is also intented to work with local (app files) because these files always exists and we can expect a more or less response from the app server.

5. I checked the ParseVars sample different times made some test in my app, also using HTTPexecute. BUT the thing is with HttpExecute action I stop the script, all script actions behind HttpExecute will not be executed.

Something wrong in your script? Because, in fact, for remote files (not app files) the "ParseVariables" is the way instead of "LoadVariables", and, in order to use this action we need the help of an HTTP Client control, like the sample you mention does. I try right now with the "ParseVars" samples and try to modify the remote variables file and all works like expected Walter.

Yes, the "ParseVariables" action can be used to get variables not only to be shown in an HTML content control, but also to use in other possible places, however, we need to take care about the flow of our app. As you know, all the actions are executed asynchronously, that is, be can't expect the variables are ready just after execute the "HttpExecute" action, we need to wait for the "Success" or "Error" events of the HTTP Client control, and use the HTTP Client response as the argument for the "ParseVariables" action.

Then we need to think in that before count with the variables: we can't use the variables until the HTTP Client control "Success" event and the "ParseVariables" call, and we also need to prepare some scenario for a posible "Error" event. Both scenarios depend on what kind of thing we try to do, I just can say at this time that both "LoadVariables" and "ParseVariables" actions works here in all the browser I test, then maybe you have some problem with your script. Maybe you can send me or prepare a sample to try to reproduce the problem?

6. So my question is, if there is a possibilty to start i.e a function "loadthis" in the show event of an view and WAIT for the end of the function before continuing the show event script. For example with a while which is waiting for a response var of the function

No. I think there is not a way to do such thing Walter. Every action are asynchronously executed. However this not meant we can't do the things, just that we need to think about how to do what we need in an asynchronous way. Then, if you want to execute "something" when the "ParseVariables" end their work, why don't prepare an app function with the "something" stuff and call to that function just after "ParseVariables" in the HTTP Client control "Success" event?

Supose we have two app functions named "GetVariables" and "ProcessVariables". Then our app view "Show" event can look something like this:

1º We call "GetVariables" and that function basically call the "HttpExecute" action to retrieve the remote variables. There is not more stuff in the app view "Show" event.

2º Once the "HttpExecute" is called we wait for the "Success" event of the HTTP Client control. In that event, we use the "ParseVariables" action (using the "[HttpClient1.Response]" variable as argument) and inmediatelly after call to "ProcessVariables".

That's all. We no need to wait for some action execution in the "Show" event, instead of that we "start" the process for retrieving the remote variables file and process the variables when they are retrieved.

7. As far as I understand now the show event script of a view is first read totally and then executed?

I am not sure if understand well, but this and all events and pieces of code are executed following the action's sequence.

8 And last but not least: Do different browsers handle the SetOption and GetOption different? Do they use different webspace? I wrote a own temporary log function which uses SetOption for the log entries. And get different resuklt using IE and/or Chrome/Firefox. confusing!

"SetOption" relies in the "LocalStorage" of every browser. In principle they must work in a similar way. It's just an space to save pairs of keys and values for our apps, then this keys and values must be the same in every browser if we save the same for the keys and values couples. There is no differences in how App Builder deal with this in different browsers Walter.

Hope this all can help you in some manner, but, remember to post here (or in a new thread) whatever you wanted.


DecSoft (In thread: Code minimizer > Sorry an error occur ....)

Hello to all,

The App Builder Code Minimizer tool (GUI) has been enhanced in order to offer information if an error occur. This information has before available when use the App Builder CLI (command line compiler) but not in the GUI version of the Code Minimizer tool. Now both offer us the same information if an error occur while minimize our apps code. Commonly this kind of errors appear by some syntax mistakes and the information provided by the error can be very useful to locale and fix the problem.


DecSoft (In thread: How to add new Cordova plugins please ?)

Hello,

Just to mention another possible approach we can take here: define a Javascript app function. We can define a Javascript app function (instead of an App Builder script function) with two arguments, "phone" and "message". The code of our function can be something like this:

If we name the function as "SendSMS" then the function appear into the Actions palette under the Function's category and we can call it like:

Finally I add this information as a new Apache Cordova custom plugins App Builder help tutorial. Also I add the new "Plugins" app sample which show us how we can custom plugins like this. Take a look if you like Samuel. :)


DecSoft (In thread: How to add new Cordova plugins please ?)

You're welcome!

Always thanks you Samuel. :)


DecSoft (In thread: How to add new Cordova plugins please ?)

Hello Samuel,

I updated App Builder right now by adding a new Cordova custom plugins option into the app options dialog. We can put in the Custom plugins editbox one or more custom plugins by specifying the plugin ID, for example, "com.jsmobile.plugins.sms" for the SMS plugin we are talking about in this post.

App Builder automatically add custom plugins into their generated Cordova batch files and also into their generated Cordova "config.xml" file. This avoid the need to edit the batch files to add the plugins by ourself everytime we build the app, since the Cordova batch files are regenerated in every app build.


DecSoft (In thread: How to add new Cordova plugins please ?)

Hello Samuel,

You're welcome. Certainly the refered actions can be very useful. However maybe the actions is not documented very well, for example, how we can access app variables from a piece of Javascript added between the StartJS and EndJS actions?

Probably I need to enhance the documentation to talk about this, but, for information purposes, let me to say here that we can access app stuff from the Javascript using the "$scope" and the "$rootScope" variables.

For example, we can modify the above Javascript code in this manner:

In the above code we use the "Input1" and "Textarea1" controls "Value" variable, and also we use the "alertBox" action defined in our app scope. Basically "$rootScope" contains all our app controls and app variables. The "$scope" contains much of the app actions into their Javascript implementation, but not all.


DecSoft (In thread: How to add new Cordova plugins please ?)

Hello Samuel,

Firstly let me to say that I test right now the SMS plugin you refer and works like a charm. Certainly a possible good new App Builder help tutorial can be how to include and use additional Cordova plugins.

Basically we need to follow the instructions of the plugin author, but, in general all the plugins work in a similar way:

1º Setup the app in order to generate Cordova Batch files, for example, for Android.

2º To use the plugin in our app we must follow the author instructions and add this code to a button click event, for example:

As you view above we use directly the plugin Javascript code between the StartJS and EndJS actions.

3º Once the app is compiled, open the "cordova_android.bat" and add the plugin install call:

And that's all! We can build now the app using Apache Cordova in order to get our APK file.

What I can do in order to help a little more this process? Probably I can add some app options in order to allow us to add custom Cordova plugins. Basically I am thinking in some editbox which allow us to put plugin installation calls, in order to tell App Builder these calls must be add into the generated Cordova Batch files.


DecSoft (In thread: MediaPlayer control - questions)

Hello Walter,

About the first question I don't understand what "True/False" means in this scenario. Do you want to disable it or what? Please explain me little more.

About the second question, as you say, disable the context menu help just a bit for downloading the video. If the user is a little smart, probably they can always access the video source. Maybe we can complicate the things from the webserver, but, to be honest, at this moment I can't imagine a way, since our apps running on the client and their source is available, even when minimized and obfuscate it.

Anyway I update App Builder in order to add some stuff related with this second question. I add to the Event's category the new PreventDefault action, and, also add a "ContextMenu" event to the app views and also to the Media Player control. Now we can prevent the browser contextual menu by using the PreventDefault action into the Media Player ContextMenu event in the below way:

We can prevent the context menu for an entire app view or an specific control by using the ContextMenu app view event, for example, the below code into such event prevent the context menu for the entire app view:

We also can disable the context menu for an specific control, for example, a "Button1", using the same ContextMenu app view event in this way:

Then what is the reason we can't use this approach to prevent the contextual menu in the Media Player event? Because the "target.id" of the app view Event variable are empty in this case and we need to deep into the Event object to properly access the Media Player name or ID. So I decide to put a ContextMenu event specifically to be used by the Media Player control.

Hope this can be useful for you, but, if you have any question don't hesitate to post here.


DecSoft (In thread: Code minimizer > Sorry an error occur ....)

Hello Walter,

I recieve the errors capture. Certainly they appear to be some "problem" in your code, in the sense that probably you are using some Javascript code which can cause the problem. Maybe I can help you more if you send me such piece of code. Maybe the problem is not produced by such code but by the interpretation of App Builder of that code. Anyway I need such Javascript code in order to investigate it.


DecSoft (In thread: Code minimizer > Sorry an error occur ....)

Hello Walter,

What about this issue? Finally you get working the code minimizer tool?


DecSoft (In thread: MediaPlayer - streaming video support?)

Hello Walter,

Firstly I need to say that I have not experience in this aspect. I try with an RTMP URL and they do not work, apparently this format is not supported by HTML5. For the Media Player component I use the fantastic Videogular player, which have certain plugin to deal with "Dynamic Adaptive Streaming over HTTP (DASH)".

Apparently the DASH MPD files are similar to RTMP but the browser support for DASH is very, very limited at this time. Maybe we can use some Flash player or something, but for sure we enter in possible lack of support for Flash in various platforms, then probably we can't do nothing about at this time Walter... I am sorry.

Anyway I am investigating about the Dash plugin for Videogular: maybe we can add it at least as an option.


DecSoft (In thread: Prevent tablets from zoom in with double-click/tap)

Hello Walter,

We are talking about apps running in browsers or Apache Cordova compiled apps? Anyway take in easy with that Walter: the user must can made zoom to suit their needs. Then maybe disable the zoom is not a good idea, just let the app start without any zoom and let the user to choose the zoom level if they requires some special one.


DecSoft (In thread: Code minimizer > Sorry an error occur ....)

Hello Walter,

Waiting for your mail.


DecSoft (In thread: Code minimizer > Sorry an error occur ....)

Hello Walter,

Good error! Nope. I will take a look at this, however, can you tell me if Java is propertly installed in your PC?

And other point: please, try to create a Batch file (from the Tools menu) and choose to minimize the app code.

Then try to run the Batch that must compile and minimize the code of your app. Please tell me if this fail or what.

Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses cookies only to store your preferences.

Ok! Hide this note More information