#1 Re: Topics related with App Builder » [Well done :) ] Feature request : Code indentation » 2017-07-09 10:53:13

Hello David,
Thanks for the great improvement. If, not perfect as you said, in my opinion, it seems to perfectly reply to the need because there is some logic in the way the code is indented.
So the brain can get used to the way the code appears and can learn how to quickly find the information.

Again, thanks a lot for your great support David smile

#2 Topics related with App Builder » [Well done :) ] Feature request : Code indentation » 2017-07-06 09:30:23

svanneste
Replies: 4

Hello,
This is not urgent, not important and more to know if it could be possible to have in a future version, an option to indent the code more nicely.

Probably, I am doing it wrong but I tested with "Auto indent" checked or not and, each time I finish a line, it doesn't seem to align with the previous one.

Here is a ScreenGif capture about what I mean
ScreenGif.gif


Of course, this has only impact on reading long codes but mine becomes quickly ugly if it is not idented (random sample below)
ce1.pngce2.png

And it becomes more difficult with more than one indentation level.

If you could put it on your To-Do list for the future, David smile
Many thanks

#4 Re: Topics related with App Builder » [SOLVED] Is the "IsEmail" action still working as before? » 2017-07-03 16:36:38

EDIT : it still works with the Text control and not the Email one. smile

Many thanks David

#5 Re: Topics related with App Builder » [SOLVED] Is the "IsEmail" action still working as before? » 2017-07-03 16:22:16

Hello David,
Thanks a lot for your quick reply. You are right in this case it works. What won't work on my side is when associated with the change event (sample attached).

Before some time (I don't remember when), I had to set the control's content inside a String and then I could check if that string was an Email (not directly from the control). Now I can't. Please, is it something I am doing wrong ?

MyApp.ab

#6 Topics related with App Builder » [SOLVED] Is the "IsEmail" action still working as before? » 2017-07-03 16:10:18

svanneste
Replies: 6

Hello,
Could someone check if IsEmail still works ? Some old code won't work anymore by me and new projects show an error.
It could be on my side.

The error is something, translated : "Exception thrown but not handled"

Thanks

#7 Re: Topics related with App Builder » [SOLVED] Retrieve the properties of Object ? » 2017-06-14 18:30:34

Fantastic App Builder smile Thanks David

NewObject "[MyObject1]"
ObjectSetProp "[MyObject1]" "LastName" "Builder"
objectsetprop "[MyObject1]" "is" "GREAT"
NewArray "[ObjectProperties]"

//Gets all keys (properties) of an Object
StartJS
window.App.RootScope.ObjectProperties = Object.getOwnPropertyNames(window.App.RootScope.MyObject1);
EndJS


ArrayLength "[ObjectProperties]" "[ObjectPropertiesLength]"
dec "[ObjectPropertiesLength]"

Loop "0" "[ObjectPropertiesLength]" "[l]"
  ArrayGetItem "[ObjectProperties]" "[l]" "[theKey]"
  ObjectGetProp "[MyObject1]" "[theKey]" "[theValue]"
  Console "[theKey] = [theValue]" "info"
EndLoop

#8 Re: Topics related with App Builder » [SOLVED] Retrieve the properties of Object ? » 2017-06-14 17:30:47

Thank you David. I will try to apply that.

Please, don't take it bad, it is not an aggressive question but only a surprised one : which such projects you have previously described (20 views or more), you don't create some functions to reuse components ?
I am probably too object oriented now (reason why I'm often lost here crying) but isn't the fact to create each view as a "small" individual app, a "loss of time" ? You are more experienced than me, so I will try to apply that way to compare

#9 Topics related with App Builder » [SOLVED] Retrieve the properties of Object ? » 2017-06-14 15:24:38

svanneste
Replies: 5

Hello David and other pals,
Perhaps I am not seing it but, do we have a way to retrieve the properties of an unknown object ?

For example : in the case of using only one HttpClient for many Views, instead of adding the data values from inside each view, I do create an object. I have thought to submit that object to an AB function which would iterate each property and put it with its value as the HttpClient.
To be able to iterate, I add the properties in a separate array in the current View. And in the function, read each item and get its value from the Object.

This works great but is a bit long when using the same mechanism from the HttpClient.Response with an unkown Object (for ex: read an object property named "keys", split it by comma, iterate the array, get the property, get the value, get the property named "subkeys", split it, etc.).

Perhaps is there a better way to achieve this ? Many thanks

Edit: for example Object.GetProperties ?

#10 Re: Topics related with App Builder » [CLOSED] IsJSON crashing ? » 2017-06-12 17:58:49

You are right, David. I am too used to receive rough strings and after that to manipulate them that I always make the error.

Many thanks for your suggestion smile

#11 Topics related with App Builder » [CLOSED] IsJSON crashing ? » 2017-06-12 17:22:18

svanneste
Replies: 3

Hello,
On my computer, IsJson generates a crash. I have tested it with the JSON2 example to try just by adding the line to HttpClient Success

// Get the number of recors in the JSON response array

ArrayLength "[HttpClient.Response]" "[TotalRecords]"
IsJSON "[HttpClient.Response]" "[isj]"

Could you please check if it is the same for you ? Thanks

[e] Error: "Exception lifted but not detected" - Line: 306 - Char: 13 - Code: 0 - Url: http://127.0.0.1:9999/app/scripts/app.js
[e] Error: "[$rootScope:inprog] http://errors.angularjs.org/1.6.4/$rootScope/inprog?p0=%24digest" - Line: 141 - Char: 496 - Code: 0 - Url: http://127.0.0.1:9999/builder/scripts/builder.js

CLOSED : Closing. I guess in that example this is an array and the help file speaks about a String... Damn that way of doing things makes me crazy never knowing what comes from which transformation.
Goodbye and sorry

#12 Re: Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-12 14:08:53

Sorry, I had forgot to thank you again, David, for your detailed information and the great help you provided smile

#13 Re: Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-12 14:05:06

A short and quick and dirty note if one is in need of the same solution :
AB sends the OPTIONS Method with the Access-Control-Request-Headers
don't wrongly reply "Yes" to what ever it asks smile because it specifies its needs with a "content-type, accept"
Only reply : "Content-Type" and a nice "200" status. Then, it will be happy to reply with anything (for example : "application/json")
From that, when you have understood that, App Builder is able to chat with any rough servlet smile

#14 Re: Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-09 20:22:54

Huh (confused). I will have to retry with a dedicated project but I think if I recall it correctly that even forcing the Transform I had got the OPTIONS (and not having found how to reply it wasn't good). Will let you know for sure wink

#15 Re: Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-09 20:15:18

Not at all David, when using the HttpClient I can't enter my scripts because the HttpClient sends the famous OPTIONS instead of the POST.
I am using the SimplePost instead and decode the multipart form this one sends smile
Enjoy your weekend holiday

#16 Re: Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-09 19:05:17

That's clear David. Last question, please before to let it down : couldn't it be possible to set SimplePost to send data instead of ContentType: multipart/form-data; boundary=---- ? When I say data, it's because :
- when I use HttpClient with the POST, it sends OPTIONS (I have not found what the Servlet has to reply (I have seen the headers reply you set in the provided php file shipped with AB's examples) ~works great with any server (said for the new comers)
- when I use SimplePost, I get the POST as Method but can't get the content from the Bytes (I should try a lot more)

Definitively closed : found a way to get the multipart. Thanks David

#17 Re: Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-09 14:43:55

You are absolutely right David, but in some cases, App Builder is (for me) difficult to insert in some projects. For example, when it sends the OPTIONS request when there is no web server in front but a only a servlet. The servlet waits for the rough data and gets nothing.

But this is out of the scope of that thread and mainly a strange use of App Builder which seems to more respect the standards compared to what I do wink

Thanks a lot again for the great and quick replies David smile

#18 Re: Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-09 10:59:24

Hello David,
Thanks a lot for your quick reply. So if I well understand, I should be able to retrieve the cookie (created by the server) exactly if it was a browser calling the server ?

I will prepare simpler example than my current project. I should do something wrong on that part.

Many thanks smile

#19 Topics related with App Builder » [SOLVED] Questions about context of the app » 2017-06-09 10:45:35

svanneste
Replies: 13

Hello David,
(I am currently focused on a short projet, so I will come back to the positioning later, sorry for that)

I have noticed something I was not aware of and wonder about the context of the app created with App Builder, perhaps could you shortly confirm or explain the behavior :

I created a java server which opens sessions and creates cookies in a web browser. But if I visit the hosted web app created with App Builder, I can not create the cookie directly in the browser (from the java server). Of course, I can use the internal action SetCookie for that but I was surprised to have to send all the data "over the air" (for example : username + passwordHash -> server -> session cookie -> app builder -> store the cookie -> send the cookie's value to the server as a data, etc)

Perhaps is there an easier way I am not used to ?  Many thanks smile

#20 Topics related with App Builder » Auto scaled apps and placement » 2017-06-02 11:38:52

svanneste
Replies: 8

Hello David,

As we told yesterday, I have tried to compute some questions about the auto scaled apps and hope not to have missed some. For that I have mixed constraints values and not ; trying to mimic the reality. The demo app source code is here : demo_placement.zip

The demo app is alive here
The screenshots can be seen here. They are screenshots taken from the Debugger and two taken from a random Android device (Lenovo K33a48 1920x1080 440 dpi)

The original app looks like this
Debugger_1_320x480.png

What I noticed :
- when rotating the device (for ex: Debugger_2_480x320.png) the first label (green) overlaps the second one)
- even if a label is put in a container with a select control, it doesn't keep its alignement (for ex: Debugger_2_480x320.png)
- on a real device (Android 6.0.1 using Chrome), the first label is under the browser's search/url field (for ex: Real_device_1.png)
- the font size in a Select control or an Input field is not kept consistent in some resolutions (for ex: Debugger_5_640x360.png & Debugger_6_1024x768.png)
- the space width between a not fixed size button and a fixed sized button (blue buttons at the end of the screen) curiously varies not depending ont the resolution (ex differences between Debugger_5_640x360.png (which seems correct because the width is the double of the original one it was developed on) and Real_device_2.png (which looks like the original layout but is 1080 px width)
- the width of buttons seems not to be consistent too. For example, "Button4" ends before "Button button with max-width" (for ex: Debugger_4_412x732.png) or ends after (for ex: Debugger_5_640x360.png but not Real_device_2.png)

Of course, this message needs not urgent reply. It is only because we discussed it yesterday. And I did not forgot that responsiveness is something difficult to achieve too.
So this is a report as we discussed. smile

#21 Re: Topics related with App Builder » [SOLVED] Vertically align a text in a label ? » 2017-06-01 23:28:35

Thanks for the two messages David. I will prepare some examples tomorrow and submit them in a new thread as you suggest it. Good evening smile

#22 Re: Topics related with App Builder » [SOLVED] Vertically align a text in a label ? » 2017-06-01 23:10:52

As a side note, not related to the wonderful help you provided, David, I would add that I found it very difficult to manage the responsiveness of the application.

For example, I finally had three lines (the HTML line including the title and two containers). I tested the responsiveness in the Debugger using as much as the screens dimensions the Debugger provides. All was pretty well.
But on some devices (mainly smartphones), the result was not the same. For example, the second line (container) was overlaped by the HTML block in landscape mode.

So I had to add some routines to compute the Top where to put the second line. So, I wonder if I have really understood the Help section about the Auto scaled apps.
And I will have to try the apps I already made because I wasn't aware of the behavior. So, I will have to study closer the Calculator app because it seems to work very well, using the media queries.

Solved for now smile

#23 Re: Topics related with App Builder » [SOLVED] Vertically align a text in a label ? » 2017-06-01 19:56:06

Hello David,
Thanks for your reply and the idea using the HTML control by itself. I will try to adapt your app sample to my needs. What could I do without your help smile ?

To explain a bit more because it was not obvious : when using a Label, its text is by default aligned at its top regardless its height. So if using the label as the banner of the app, its text is never aligned to the vertical center of the label when it's resized. I saw it by chance visiting a current app from my phone and not my laptop.

Thanks again

#24 Topics related with App Builder » [SOLVED] Vertically align a text in a label ? » 2017-06-01 17:43:53

svanneste
Replies: 7

Hello,
I am that guy trying to create a banner on a responsive app but without being able to vertically align the text in a label.
I tried many options like putting the label inside a Container too. Crawled the web but didn't found the solution.

I can see the SetStyle working but the text won't move. I am sure, I am missing something, perhaps could you help on that ?
demo1.png

Many thanks

Example APP


EDIT: after reading the W3Schools, I understood that vertical-align didn't apply to labels... But how could I vertically align my label in a container ? I am working on that now

EDIT2: really tricky, using the label inside a container inside another container but hard to remember and to really  set http://phrogz.net/CSS/vertical-align/index.html

EDIT3: almost there : the label should be set in a container with the relative position, the label's position should be absolute and its top should be 50%. But while changing the resolution, the Text inside the label goes out the label itself... To be continued

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.