Hello Amin,
Always thanks you for support our work! :-)
Posts by DecSoft Hello Amin,
Always thanks you for support our work! :-)
Hello Amin,
If that works for you, it's good. However, I have some considerations. Firstly, maybe you can use "ng-show" or "ng-hide" for your specific purpose, instead of "ng-if". I am not sure right now about the "ng-if", but, the "ng-show" and "ng-hide" can be used in the same element that you wanted, that is, you no need to put it in a container, if you don't wanted that.
So we can do something like this, for example:
And, in the above case, the link is only shown if the Record's ID is greater than 1.
Hello Amin,
About the first question, certainly the "A" tag (or link) made the things a little bit complex, but not imposible. Supose we have an HTML code like the below one in a Report control:
Note that all the attributes are used above. The "href" do not point to any URL or file name. The "onclick" attribute is used to "return false", in order to prevent that the link do their job: goto another place. The "class" attribute is used later (see below) to identify the link, that is, to know that the user tap in a link that must made certain job. Finally, the "id" attribute is used to store the Record's ID, in this case, but, we can store another possible value, or use another "data" attribute if needed.
For the above Report's HTML code, we can place the below AB code in the Report's RowClick event:
The first thing we do above is to identify the link, that is, as you can see, we look if the clicked element (a link in our case) have the class "do-the-job". If that is thruth, then we execute the "Alert" action, which shown the ID of the link that the user tap. So we can identify if a particular link is what we expected. Then we can take some information of the link, like their ID attribute, in order to do what we wanted: goto another view, for example. Maybe in your specific case you can try with a "modal view" instead of a "normal view". But this is something that you must decide.
About your second question, the answer is yes: when the Report was press by the user, no matter if they do in a link or another element, the "[Report.Record]" variable contains the data of the pressed record in the Report control. So, if you want to use this information you can also use it when the link or other element is pressed. Please, go ahead if you have any further question about, Amin.
Hello Amin,
I feel that the forum "editor" is very bad, and, force us to do miracles to get something good and finally post what we wanted. I must work on this, of course. Anyway, certainly we can use the "ng-if", "ng-class", etc., without problems. It's something more or less advanced, but, we can use it. What I want to remark is that they are not the only solutions, but, certainly we can use it and works as expected. So just post here (if you can! :-( ) if you need any help on that.
Hello Amin,
Just to add a bit more information regarding the better usage of the Report's Data variable, that is, for example, including some "CSS classes" information per every record object, remember that we can also do this in runtime and in the client side. Maybe is not the better approach (the better approach can be that the server already serve the data as we needed), but, we can always change (remove, editing, adding object properties) to the Report's Data variable. In few words: we can incude in the Data variable whatever we wanted... like the appropriate CSS classes to be used.Hello Amin,
We certainly can use something like the "ng-if" AngularJS directive, however, for something like you wanted, probably we must use the "ng-class" AngularJS directive. Please, take a look at the two refered links, mostly to the "ng-class" one, and, tell me if you need some additional help.
On the other hand, we can always use the source data, that is, supose we want to list certain records in a Report, then, every record object can have their own "class" property, then we can simply use it, instead of the mentioned "ng-class" directive. However, there is also possible to use it.
Here is an example of use of the "ng-class", however, there is just one example: this directive is powerful and allows to be ready with the classes to be applied in various ways, this is the "map way":
The above means "Apply the greaterThanOne CSS class to this TD element, if the Record.ID value is greater than 1. Apply the recordIsJohn CSS class too, if the Record.Name value is not an empty string."
The above "ng-if" directive means, "Shown this TD element if the Record.Name value is evaluated to true, or, hide this TD element in other case".
Hello Tin,
I didn't want to say like this...but the old forum is better and access easier then new one...
For some reason.I have to login every time I visit,but the old one remember me...
But this forum is look good if view in Appbuilder welcome screen..
As you may already see, the login of the DecSoft website has been improved and now you can mark the appropriate checkbox in order to maintain you logged during ten days. This applies too when we visit the website (the forum, for example) from the AB welcome page.
Additionally, probably you already see that I also improve the DecSoft's customer area: now the first tab is the "Support" one, and, shown your latest support forum threads and posts, as well the latest forum threads and posts of other customers.
Hope this can be useful for you and for others also, Tin. :-)
Hello to all,
That's good! Thanks Tin for use your avatar here in the support forum. :-)
P.S. Thanks also Amin for use your avatar! :-)
Hello to all,
Yes, Websocket server is an option, but with that a dedicated server is required, then you have to ensure it’s WSS sockets not just WS - then the requirement to add self signed certificates to devices if you’re running an iOS app.
I am not sure about what you said. We use WS (not WSS) in certain app that works also in iOS like a charm.
Why bother with all that when a dedicated platform has the ability to manage the backend (reliably without the need for you to run a dedicated server) and with more functionality.
I think that nothing can offer more functionallity than a dedicated server. Of course it's not cheap than a non dedicated one, but, just the ability to run your programs, like a WebSocket server, is just amazing.
With Pusher, again you’re not able to initiate direct connection from JavaScript to the service without your own server via PHP, so that seems like a barrier.
I certainly ignore that "limitation". But, again, honestly I think that have an app's server is more or less mandatory. Maybe we no need a dedicated server, but, at least some server... in order to do what we simply can't do in the client side.
And with the changes coming into play from webview to wkwebview in the iOS SDK, websockets will only work if it’s a secure and uses the wkwebview - so long term, webosckets will break in any Cordova app that’s not using the new wkwebview component.
I am not sure about what to say on this. In principle, when the "wkwebview" become available, Cordova must support it. Then, we can be quiet on that point. Additionally, we can use certain Cordova plugin right now if we wanted to use the wkwebview instead the default one. And, if we must chante the "WS" to "WSS"... well... maybe it's a good thing to do that.
So, That’s why using a 3rd party service to deal with the backend for messaging within apps is a better solution in my opinion, and the PubNub service allows you to do a lot more even by just using the publish and subscribe APIs.
I no discuss if PubNub can be good, of course. Probably is a good service. I just place my opinion: if we wanted a chat, a Websocket server can be also fine. But, if we want to use a thirdparty server like PubNub, why not to do it?
Anyway, I am not sure if my prepared sample can be useful for you or not, since you simply don't mention it. I hope that that sample can be useful for you, of course. :-)
Hello to all,
I want to add something more to my previous post. :-) I am not quite sure if what you wanted is something like a chat. If so, remember the possible usage of a WebSocket server and the WebSocket control of AB. I certainly have a very good experience using this to made a more or less complex chat for a couple of apps that I develop.
Not easy! We need a dedicated server. And we need to work in the server side and the client side too, but, certainly the chat is provided by us, instead of a thirdparty server, and, on the other hand, the WebSocket server and the WebSocket control in AB works like a charm. I am very happy with their usage, at the least, and the mentioned apps' chats have features like the "online/offline" presence of the users, the "Is typing..." message and more.
The chat system for the refered app take me tons of work... but after that they works like a charm and we are very happy with that. The magic of the WebSocket server and the Websocket control is, of course, the ability to maintain a persistent communication between the app and the server side, so, we can be notified by the server in certain events.
Another thing that I want to add to my previous post is that I don't want to interfere with your offer, that is, maybe some AB user can certainly help you in your task, that is, go ahead the quick start guide that I shown in the above linked sample app, that I hope that can help you in something. :-)
Hello to all,
The services that PubNub offers are quite large, that is, if we just take a quick view, we can see that the number of services, the different APIs, the complexity of that APIs, etc., are not simple at all. I want to recommend the lecture of this article from Nick Brandury: Favicon Hell: Small Feature, Big Code. Basically we can know where we start... but it's no possible to know where we finish.
If I am not wrong, the particular service that you link is quite similar than the Pusher.com service offers (we have already a Pusher control in AB). Well. We start with problems, since, the Javascript SDK that we must use, apparently, is not available in the CND link that the service offer. There is no problem... we can get the code from Github, fortunatelly, so we can try to follow the service's start guide.
And, certainly, we can "simply" copy the code of the start guide and adapt it to an AB app, just like in the below way:
https://www.decsoftutils.com/_support/uploads/PubNub.zip
You must open two instances of the app to see it working, that is... a sole instance of the app works like expected, but, probably you want how the apps can interchange messages in real time, don't you? For that, run the app in AB, type an user name (like "John") and then run the app in a browser like Firefox, and, type another user name (like "Peter"), then you can see how both instances of the app can interchange messages in real time.
This means we end the work? Not at all! We just start with the work... we just follow the start guide... but we must continue working... studying the service API, probably implement lot of things in the server (we want to save the history of messages in a database?), etcetera, etcetera, etcetera. I want to finish by a quote of the refered Nick Bradbury's article:
I know that response sounds glib to those who hear it, but it’s really me being honest. If I haven’t tackled a feature in code yet, then there’s no way I can reliably estimate how long it will take to complete it.
I completely agree with Bradbury.
Hello Amin,
Please, upgrade your AB copy. As you can see, now we can use multiline comments in the code editor, just starting by /* and ending by */
Hello Amin,
I want to take a look, however, I can't promise nothing right now... remember that, certainly we only can use single line comments, but, we have a couple of buttons in the editor toolbar and the editor contextual menu to "comment" and to "uncomment" one or more lines. :-)Hello Amin,
Always thanks you for your support and for your kindly words. :-)
Hello Paolo,
If I am not wrong, the API that you want to use is only available in Chrome for Android... apparently is more or less simply to use, we can place the below code in a Button control Click event, for example:
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.