Posts by DecSoft

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

DecSoft (In thread: Checkboxes in Google Chrome, Z-Index and no-cache meta tag)

Hello Walter,

This works to me in all browsers I test, including Chrome:

Then take care about "[myObject_Y]" and "[myObject_X]" variables. Also take care about "[myObject]" variable. This cannot be the same name than the Checkbox control. You can always specify the name of the control if you like:

About the "no-cache" meta tag, please, let me sometime in order to investigate it.


DecSoft (In thread: Problem with setting variables from JavaScript Callback)

Hello again,

Just to say that the current available release of App Builder have a new Barcode control (based in the same Adobe Phonegap plugin you use), a new BarcodeScan action and a new Barcode app sample. Take a look if you like Jürgen and hope everyone found this new control useful! www.getappbuilder.com


DecSoft (In thread: Problem with setting variables from JavaScript Callback)

Hello Jürgen,

Don't worry at all. Yes; in these scenarios we can use the ApplyModel action, in order to tell the GUI that some of our model variables changes. Use this action in your "BarcodeReaded" app function, after you set the "barcode result" variable.


DecSoft (In thread: Problem with setting variables from JavaScript Callback)

Hello Jürgen,

Always thanks you and thanks to tell me you finally got it!

Hello David,

the solution with:

is really cool. Works really great.

Thanks for helping me.

Best regards
Jürgen


DecSoft (In thread: Problem with setting variables from JavaScript Callback)

Hello again,

Please, update (if you like) your App Builder copy: I add the new External app sample, which show us how we can set an app variable and call an app function from external app Javascript code: www.getappbuilder.com


DecSoft (In thread: Problem with setting variables from JavaScript Callback)

Hello Jürgen,

My latest post solution must works like expected, however, I forget than "window.App.RootScope" variable dot not give us access to app functions, which made the solution unuseful.

I made the appropiate changes right now in order to allow us to get access to app variables and app functions too. However, note that I rename "window.App.RootScope" to "window.App.Scope" to maintain some internal coherence.

You need to update your App Builder copy to get this changes ready! www.getappbuilder.com

And remember:

1º Call an app function when the barcode is ready:

Or:

If you need more help please tell me. If you finally got it please tell me too.


DecSoft (In thread: Problem with setting variables from JavaScript Callback)

Hello Jürgen,

Certainly the problem is that "scanresult" function is executed asynchronously. If I am not wrong "ScanBarcode" is an app function which is called in order to retrieve a barcode. however, such function launch the Barcode "picker" (correct?), and, until the user really scan the barcode the, the "scanresult" nor "scanerror" are executed.

Then we can't use the variable "Barcode" just after call the "ScanBarcode" app function, because such variable is not available at all until the user scan the barcode. What is solution? The solution is to react when the "scanresult" function are executed. My suggestion is to prepare an app function, say "BarcodeReaded", and write something like this in the "scanresult" function:

We can also add a "Text" argument to the "BarcodeReaded" function, then we can simply write something like this:

This is the way in which this kind of things works, not only for the barcode plugin. For example, the we can't write something like that using an Http client control:

The above "AlertBox" can't show the Http client response, because they are not available until the Http client Success event is executed. If in the future I implement the Barcode plugin in App Builder, they must have an "Success" and "Error" events too, in order to be ready when the user scan a barcode.

Hope you can understand this Jürgen, when not, don't hesitate to continue posting.

** Please carefully read the next post **


DecSoft (In thread: Problem with setting variables from JavaScript Callback)

Hello Jürgen,

The problem here is that "scanresult" function is executed asynchronously, then what we assign to "window.App.RootScope.Barcode" is the first defined "barcode" variable value, that is, "HELLO".

Once "scanresult" is executed, what you do is to assign the "result.text" to the "barcode" variable, not to "window.App.RootScope.Barcode". Then the solution is to assign the "result.text" to this variable:


DecSoft (In thread: KeyDown event? Checking user's inputs on keyboard (and mouse click))

Hello Walter,

The above code look well except for the "document.getElementById('action')", which maybe cause an error if the element "action" doesn't exists. On the other hand, try to leave the "index.html" without changes, since this file is generated automatically by the program in every debug/build operation. Then you can use a separated Javascript to do something like that.

Update your App Builder copy because I update it in order to add the KeyUp and KeyDown events for all Input controls, Textarea and Typeahead controls. You can use such events like others in App Builder, and remember the variable "Event" of the control contains the information about the event, then in the case of the KeyUp and KeyDown events, for example:


DecSoft (In thread: No more messages in Console)

Hello Walter,

Oh yes... I am very worry Walter. The Console action support now a second argument (with the kind of console message) and therefore the action are not recognized with only one argument... you need to add such second argument to the Console action calls:

Please sorry for the inconveniences.


DecSoft (In thread: Modify the Report Sample App to include functions (Add, Edit, Delete)?)

Hello CIS,

I think your PHP do not look what we can expect. For example, your PHP scripts produce HTML code, which is something that your app do not expect. Your app provide all the required HTML, you no need to worry about it in the PHP scripts. These scripts must "act" when are requested and must responde with the appropiate data. No more.

You no need an HTML form to send information to your PHP scripts: you must use the Input controls what you need and then use the Http client control to perform the appropiate HTTP POST request. On the same way, you no need to list your database data by output it from PHP scripts. Your scripts must return JSON data that the Report control can parse and show automatically for you.

I am very sorry because this app sample are not trivial at all, probably take me several hours, and currently I am very busy with other project areas. Again, try to understand what you need and ask here for help when you needed. I am very sorry but I can't say other thing at this time. Just remember:

1º add.php - Need to receive POST data and their response can be, for example, just an "OK" or "Fail", in order to understand from our app the data has been added.

2º edit.php - Need to receive POST data and their response can be, again, just an "OK" or "Fail", in order to understand from our app the data has been updated or not.

3º list.php - Only need to return the appropiate data as a JSON object. This script must be very similar to the "data.php" you can found in the current app samples. That JSON object is parsed and show by the Report control.

4º delete.php - Need to receive POST data and their response can be the same than "add.php" and "edit.php".

On the other hand, remember we need to enable "CORS" requests in our PHP scripts. You can view how by read the "data.php" refered above and included into the Report app sample. This may are not needed for the local web served files (probably not) but "CORS" must be enabled for our PHP scripts when use a remote server.


DecSoft (In thread: Modify the Report Sample App to include functions (Add, Edit, Delete)?)

Hello CIS,

First of all, note than the "InputBox" action callback must be an app function, not an action like "StrReplace" as you write. Take a look at the InputBox app sample for more information. On the other hand, probably you need to decide what action execute next: "HttpExecute", "SimplePost" and "SimpleGet" probably cannot be called like you write above.

If you choose to use the HttpClient control to made an HTTP POST it's ok, but you no need to call "SimplePost" at all. On the other hand, "SimplePost" do not offer any feedback, then maybe it's not the right action in your case. Finally you call the "SimpleGet" action, but, again, probably you no need to do something like that CIS.

You can play with the app using a local webserver (*), just remember that if you want to use PHP and MySQL these stuff must be available and running in the local webserver too. We need to think our app is a act like a web page in these scenarios, and therefore we must made the appropiate HTTP GET and POST requests. We can need more or less calls, the Report control or others, depending of the app we made.

If you start with the app I can help you in some particular points when you need! In other case I can't promise when I a possible app sample like you wanted can be ready since I am very busy right now with other App Builder stuff.

(*) Remember that App Builder debugger starts an HTTP local server, then, if you need to work with other local server you must use different ports. By default App Builder uses the 9999 port and this can be changed in the program options dialog from the Menu -> Edit -> Program options.


DecSoft (In thread: Modify the Report Sample App to include functions (Add, Edit, Delete)?)

Hello,

As an addition to my previous message I want to say than the Report control is very powerful and right now App Builder include four different samples: Report, Report2, Report3 and Report4.

A Report control can be feed using their URL variable. Then the control automagically perform the HTTP request, retrieve the response and prepare the data to be show into the Report table.

Maybe we are a bit confusing with the samples "data.json" and "data.php" files. In fact we can include files like "data.json" in our apps in order to feed a Report control with the file app local URL.

"data.php", instead, is a sample of how the JSON data can provide from a webserver and therefore can be dinamically changed or updated in order to allow our apps to show the latest information.

On the other hand, the Report control can also be feed by using their "Data" variable instead their "URL" variable. And this can be made at least in two ways: load JSON data using an action like "SimpleGet" or prepare our own JSON object using the object related actions.

This last way is particularly interesting because we prepare the JSON object in runtime and therefore such object can contains different information in different scenarios. The App Builder's Report3 and Report4 show to us how to do something like this.

That's all! Hope this information can be useful!

Don't forget to play with the App Builder's app samples!


DecSoft (In thread: Modify the Report Sample App to include functions (Add, Edit, Delete)?)

Hello CIS,

Certainly we can prepare the required stuff to not only retrieve and show information from a webserver, allowing to add and edit information too, but probably this is out of the scope of the Report app sample. Maybe we can prepare an specific app sample to doing something like you wanted, however, in the meanwhile, note what are the required stuff in order to do something like that:

1º We firstly need a webserver capable to receive HTTP GET and POST requests and also to store the information in some kind of database like MySQL, for example.

2º We need to prepare some kind of API accesible by HTTP calls in URL like the below ones:

3º We can use a Report control to process and show the JSON data provided by the "get.php" HTTP requests. Note we can add some arguments to the URL in order to retrieve specific information, for example, this URL:

... can produce different results than this other URL:

4º The "edit.php" script can be ready to accept some record specific ID, for example:

The above URL can respond with a ready to parse variables list text like these:

We can use the "ParseVariables" action to get the variables from the response and show their content in a couple of Text input controls.

5º The same app view which show that Text input controls can have a Push button to made an HTTP POST request to the same "edit.php" script, providing the updated information of the edited record.

6º In order to add new records to the database we only need the appropiate Input controls and to made an HTTP POST request to the "add.php" script, providing the appropiate record information.

Probably this is not a complete answer since I do not add what you wanted to the Report control, but I tell you how something like that can be made using App Builder. Maybe in the near future we prepare an app sample around this.


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

Hello Nelson,

I think we can use npXmls but they require too much work than use npRexp. npXmls is a very complex plugin which allow us to parse arbitrary XML, but requires some work in order to get ready for what we wanted. npRexp is more close up to this kind of problems, since we can provide a regular expression of our search query and simply get the available matches.

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