#1 2017-02-27 09:52:54

Antonio.Cambule
Member
Registered: 2017-02-19
Posts: 38

[solved]: In need of an multi line Alert- or Messagebox

Good morning,

while I'm trying to get my validation run, i noticed that it is not possible to use
linebreaks inside AB Alertbox oder Messagebox. Or better, i can use it and it gets parsed but
but no linebreak will be executed.

Could this be changed?

I've seen that a JS-Alert can use linebreaks, but they don't look so fancy like the AB ones ;-)

thanks and regards
Antonio

Last edited by Antonio.Cambule (2017-02-27 16:28:19)

Offline

#2 2017-02-27 10:19:47

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Antonio,

Good morning! A couple of things to consider here. First of all, certainly the native Alert doesn't look too better, however, is native... and, for example, in Android, the native Alert (and including/checking the Cordova's Dialogs plugin in the app's options) looks very nice. So this is the first thing to consider.

The second thing is, what about use certain app view to act like the "alert dialog"? May you can prepare a Textarea or HTML control in an specific app's view, and then, use the ShowDialog action to shown that view in a dialog way. So in certain mode you can create your own custom message box using an app view.

Hope this can helps!

Offline

#3 2017-02-27 11:21:58

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Antonio,

My above reply continue be valid, however, you can also upgrade your AB copy, because now both "AlertBox" and "MessageBox" actions supports multilines in their contents. However note that we are talking about HTML content, so you must modify your code to replacing the "\n" line breaks to be "<br />" HTML tags.

Offline

#4 2017-02-27 16:06:08

Antonio.Cambule
Member
Registered: 2017-02-19
Posts: 38

Re: [solved]: In need of an multi line Alert- or Messagebox

Hi David,

thanks for your input. I've tried out both solutions now,
i didn't know that the Alert will be used as native alert, so yes this one looks good and is multiline. Fits my needs for now.

I also like the dialog solution, just one question here. Is it possible to make the DialogView smaller than the other views?
I ask that because when i show the dialog in modal its so large that is scrolls ab bit and i would like to prevent the dialog view from scrolling,
it should be less in the height.

thanks and regards
Antonio

Offline

#5 2017-02-27 16:16:42

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Antonio,

Yes; Please, in the app's view that you shown as a dialog, put the below code in their Show event:

Math "[App.InnerHeight]-50" "[Height]"
SetViewSize "" "[Height]px"

Offline

#6 2017-02-27 16:28:01

Antonio.Cambule
Member
Registered: 2017-02-19
Posts: 38

Re: [solved]: In need of an multi line Alert- or Messagebox

Great!

Offline

#7 2017-06-01 16:34:57

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: [solved]: In need of an multi line Alert- or Messagebox

I use 'ShowDialog '

Math "[App.InnerHeight]-50" "[Height]"
SetViewSize "200px" "[Height]px"

but only the view's height is changed ,the width seems not work


Joshua.Y

Offline

#8 2017-06-01 16:38:05

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Joshua,

reg4app wrote:

I use 'ShowDialog '

Math "[App.InnerHeight]-50" "[Height]"
SetViewSize "200px" "[Height]px"

but only the view's height is changed ,the width seems not work

Due to certain recent enhancement we can't use the "SetViewSize" action on modal views anymore. Instead of it we can use the "SetStyle" action instead:

Math "[App.InnerHeight]-40" "[Height]"
SetStyle "AboutView" "height" "[Height]px"

* The above code is used in the AboutView of the App Builder's Database app sample.

** The change that I talking about is refered in the program's history file (Menu -> Help -> History):

2017.42 (05/25/2017)

* The global app's variable [App.CurrentView] is no more modified by modal views, that is, when we show a view in a modal way (using the "ShowDialog" action) that view do not modify the [App.CurrentView] variable. If we needed, we can continue using the [App.DialogView] global app's variable, which contains the current view showing as modal.

Offline

#9 2017-06-01 16:47:41

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Joshua,

Please forget my previous post and upgrade your AB copy:

2017.44 (06/01/2017)

* A recently changed causes that the SetViewSize action cannot be used in modal views (we must use the SetStyle action instead). This release fix this unexpected behaviour and now we can continue using the SetViewSize even in modal views.

Offline

#10 2017-06-02 02:04:48

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: [solved]: In need of an multi line Alert- or Messagebox

I changed the Showevent code in 'AboutView' of the sample database

SetViewSize "350px" "[Height]px"

But the width of the 'AboutView' is still not changed,
as the pic showed bellow

QQ圖片20170602075625_afterchangecode.jpg


Joshua.Y

Offline

#11 2017-06-02 02:11:07

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: [solved]: In need of an multi line Alert- or Messagebox

this pic will show better
20170602080637.jpg


Joshua.Y

Offline

#12 2017-06-02 07:09:25

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Joshua,

Where you place the action? In the view's "Show" event, don't you? Are you updated AB? Are trying with the "Database" included sample? Are you sure the "[Height]" variable is really available? The action works here, so, must work in your case too!

Offline

#13 2017-06-02 07:36:55

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Joshua,

Probably this do not affect this case (because we are using the action in a modal view), however, I discover an introduced bug if we try to use the action over the first initial view (no mal) for example. I fix that bug so please, before anything, ugprade your App Builder copy!

Offline

#14 2017-06-02 08:10:44

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: [solved]: In need of an multi line Alert- or Messagebox

I update my AB

in  database sample,'AboutView' Show event

SetViewSize "60px" "310px"

It seems I can set the height of 'AboutView',but the width is not set,
only the width of the Html control and the Button in 'AboutView' has been set

20170602140157.jpg


Joshua.Y

Offline

#15 2017-06-02 08:16:34

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [solved]: In need of an multi line Alert- or Messagebox

Hello Joshua,

I got it. Certainly this appear another issue that must be investigated.

I will do it when possible and then inform you about!

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.