Posts by DecSoft

Show threads by DecSoft
3346 posts found, page 221 of 224

DecSoft (In thread: How to use CSS files and classes)

Hello Walter,

Yes; is possible to use the SetStyle action just like you suggest.

Just assert you use an URL or a previously added app image file.

Take a look at this app sample.


DecSoft (In thread: php/MySQL and AppBuilder)

Hello Nelson,

The problem is that access SQLite from the HTML5 API appear to be droped in the future and is currently not supported by IE, for example. Currently you can use plain text, JSON files and local storage in order to store and retrieve app data. And also can use HTTP calls in order to update or add new information from the app.

How the HTTP calls are made depends completely on the app, because many different servers/languages can be used for this purpose. Probably you no need to send SQL queries along internet, because you can prepare end points for your app calls in order to retrieve or set database information.

Unfortunatelly we can wait an entire life for view a SQLite support in web browsers Nelson...


DecSoft (In thread: MultiSelect control - index of SelItem(s))

Hello Walter,

In a Multiselect control we do not have an "ItemIndex" variable like in the Select control. What we have is an "Items" variable and an "SelItems" variable. Since "SelItems" variable contains the selected items, if a user choose one item, then the "SelItems" variable contains one element with the selected item value.

From that value we can use the ArrayIndexOf action over the select items array in order to get the selected item index. Take a look at the bellow code, which you can put in a "Change" event of a Multiselect control (which contains a few items):

Note that in the above code we also check the user select more than one item. If so, we take the first of the selected items and omit all others. If you have any other doubt do not hesitate to post here Walter.


DecSoft (In thread: php/MySQL and AppBuilder)

Hello Walter,

Testing with the SamplePost app sample I can write something like this:

And works like expected, in the sense that I can get the into the "sql" POST variable the text "SELECT * FROM test";.

Maybe the problem is how you try to use the "sql" POST variable in PHP. First of all assert you receive such variable by simple "echo" it. Secondly assert you can use the content of such variable in the context you wanted to use. For example, maybe the quotes of the text cause the problem. Try something like this instead:


DecSoft (In thread: php/MySQL and AppBuilder)

Hello Walter,

Connect PHP and JS sound a little confuse, since PHP is a server language and JS is a client language, then by definition their have different scenarios. Depend on what you wanted the answer can vary. Make HTTP request to a server in order to be processed by PHP is very simple by using actions like SimpleGet, SimplePost or the HttpClient control.

What data we can receive from a server and how to deal with it depend on every app. Take a look at the Report app sample, for example. This sample show us how we can parse JSON data into an HTML table. The JSON of the app sample is loaded directly from a file (included with the sample) but the sample also incorporates a "data.php" file, which show us how we can create (in a server) the JSON to be received and processed by the app.


DecSoft (In thread: How to use the container?)

Hello Walter,

When we add controls inside a container control in designtime these controls are also inside the container in runtime too. For example, if you wanted to show or hide the container and all the controls inside you can use the Show, Hide or Toggle actions indicating the container name or ID. About the resolution you can try with some app events like Resize and Orientation, and count with some app global variables like "App.Orientation", "App.InnerWidth", "App.OuterWidth", etc.


DecSoft (In thread: [not urgent and not important] Actions toolbar sorting)

Hello Samuel,

Thanks for your comments. Glad to know you are updated with the Typeahead input control. About the Tools and Actions panels, you know the first App Builder releases do not allow us to filter them. Filter is something important due to the number of Tools and Actions. I think the best way to find for Tools and Actions is to use the filter feature.

On the other hand you are right: the Tools and Actions panels do not appear sorted alfabetically and I also think this can be useful. I need to think a little about but I promise that, at least I want to try with a possible solution.


DecSoft (In thread: General question in Javascript / AppBuilders vulnerability)

Hello Walter,

That probably depends on the app, however, a general advise can be we never, never trust in the user input, then validate such input in the app (before send to the server) and always in the server too, before put the input in a database, for example. If you can explain a little your preventions maybe I can help you in some manner.


DecSoft (In thread: How to use the container?)

Hello Walter,

A container control basically allow us to put inside other controls, then, for example, we can hide/show the container and then hide and show all the controls inside the container. What kind of sample you wanted Walter?


DecSoft (In thread: Correct usage of Watcher ?)

Hello,

At a first time we can expect the HTTP data are also available for GET requests, however, if we think a more in deep probably we reject such idea. If the server take the data of a HTTP GET request from the URL... then it's the URL which contains the HTTP GET data... or not.

Then, if we want to make an HTTP GET request which include some data we can just prepare our URL in the way you already know Samuel:

Doing something like the above is perfectly valid and in fact we no need to do nothing more. If we wanted to send to our server some other kind of data, for example, some app input control values, probaly it's a better idea to use an HTTP POST request instead of an HTTP GET request.

However, if we want to do an HTTP GET request in this last case, we can enter in problems if the input control values contains certain characters. For this I add the new EncodeUri action and DecodeUri action into the Strings action's category. This actions allow us to encode an input value in order to be safelly used in our request URL, for example:

Probably you no need these actions right now Samuel, but, for sure they are needed if we plain to made some HTTP GET request like the above one. Of course I insist that to send data to our app server it's probably better to made an HTTP POST request than an HTTP GET request, and, in this case we can also get beneficts of the HttpSetData action.


DecSoft (In thread: Correct usage of Watcher ?)

Hello Samuel,

This shock me a little, because I expect HTTP GET requests also accepts the values added to the HttpClient, however, this is apparently reserved for HTTP POST requests (and probably others like PUT, DELETE, etc.). In fact they have some sense, and certainly taking a look at the Firefox debugger panel we can see that the request is made without incorporating any possible data.

I want to take a look at this in more deep. However, you know we can simply preparing the right URL. On the other hand, maybe a couple of actions can be useful here in order to decode/encode such kinds of URLs, on the first time, and maybe some action(s) in order to provide us an easy way to prepare URL with some keys/values.

Just let me sometime in order to think about Samuel.


DecSoft (In thread: Correct usage of Watcher ?)

Hello Samuel,

Maybe it's more easy to you to use a couple of HttpClient controls. One for the first request and another one for the second request. But yes; the HttpClient control can assert if the HTTP request have success or not, and then allow us to react to a success or error situation. Other actions like SimpleGet or SimplePost are useful (because no need to be ready for any event) but cannot be used if we need to assert an HTTP request result.


DecSoft (In thread: Correct usage of Watcher ?)

Hello Samuel,

Don't worry: you are not crazy. That's the default behaviour for the "Watcher": their Change event is executed when the app is load, but, do not means the associated variable has changed. What we can do it's the same that the Watcher sample does in the Change event: check if the "[WatcherName.OldValue]" and "[WatcherName.NewValue]". Something like this:

I try to clarify a little this question by doing two things: add into the Watcher help the reference to these old and new variables. They are referenced before, but only in the Change event help. On the other hand, I fix a mistake and also add these variables to the variable's selector.

Said this, I am not sure if you can achieve what you wanted using a Watcher. Maybe yes, but, probably we can take another approach. In few words, the SimpleGet and SimplePost actions exists to made HTTP request mainly to app files and without worry about asynchronous issues.

For example, the SimpleGet variable can be useful to load certain content to be show in an HTML content control, for example. But if what we need is to assert than an HTTP request is made and end successfully or with an error, then the HttpClient control is for us.

You can use various HttpClient controls or just one, because you can made an HTTP GET request with such control and then establish another HTTP method and execute another HTTP POST request, for example.

Then try with the Watcher if you like Samuel and tell us if they works, or think in the use of one or more HttpClient controls.


DecSoft (In thread: How to use CSS files and classes)

You're welcome Walter! :)


DecSoft (In thread: How to use CSS files and classes)

Hello Walter,

From the app file's manager you can add CSS stylesheet files and Javascript, which are not only included along your app files but also linked into the app HTML. Then you can prepare a CSS file for your app and then add it using the app file's manager.

Note that App Builder store the added styles into the folder "\www\app\styles\", then you can use relative paths from this folder to refer, for example, to added image files, from your CSS stylesheet.

For example, suposing you add a "Background.png" image from the app file's manager. To add this image as the background for every app view we can write something like this in our CSS stylesheet:

All app views have the class "appView". Also the app views have an ID which you can use from a CSS stylesheet. Such ID is the view name, for example, you can apply styles for some "AboutView" using the "AboutView" ID.

The same can be said about the app view controls. Every control have their own ID, which is the same than the control name. For example, a "Button1" control can be matched using the "Button1" ID.

The "AddClass" action add one or more CSS classes for an app view and most commonly for app view controls. For example, if we want to add the CSS class "myClass" for a "Button1" control we can code something like:

We can also use the action to add various CSS classes at a time, separating the classes by spaces:

Remember we count with related actions like "RemoveClass" and "HasClass". The first one allow us to remove one or more CSS classes from a control and the second one tell us if some specific class exist in certain control.

Also remember that behind our apps we have available the Bootstrap CSS framework and therefore we can use all available CSS classes declared in such framework further orther great stuff.

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