B4A Library [B4X] [XUI] AS TextFieldAdvanced - Title, Information, Counter, Password, Button, Prefix, Suffix, Icons, Multiline

incendio

Well-Known Member
Licensed User
Longtime User
Perhaps you could consider my request :
Add field type date, integer, float, and formatted field.

1. Type date, read only, when user clicked it, date picker shows

2. Type integer, virtual keyboard change to numerical buttons only but no fraction can be inputted

3. Type float, same as type integer, except users can input pre-defined fraction, for example float(2), mean that users can input only 2 decimal

3. Formatted fied, only apply to type integer and float.
To format text fied value when not in focus.

Example, text field has a value 1000, when cursor not focus, it will display as 1,000, but when cursor is in focus, it will display 1000.
 

Alexander Stolte

Expert
Licensed User
Longtime User
1. Type date, read only, when user clicked it, date picker shows
Set the mode to "button" and use the ButtonCLick event to add the AS FloatingPanel on it.
If you need inspiration then look on the gifs in this thread:
For Date, use the AS DatePicker, for Time use AS WheelDateTimePicker and load this to the AS FloatingPanel panel.

2. Type integer, virtual keyboard change to numerical buttons only but no fraction can be inputted
Set KeyboardType to Numbers
3. Type float, same as type integer, except users can input pre-defined fraction, for example float(2), mean that users can input only 2 decimal
Set KeyboardType to Decimal
 

behnam_tr

Active Member
Licensed User
Longtime User

Set KeyboardType to Numbers
Set KeyboardType to Decimal

its only available in b4a

in b4j I am using this codes for any textfields:

 

incendio

Well-Known Member
Licensed User
Longtime User
I know, it can be achieved by set the keyboard, but it is simpler if it already built in in this library.

Imagine an app in B4A with lots of B4xPages, each page have lots of different type of text fields.
Every time focus changed, keyboard type must be set according to field type.
 
Last edited:

Soheyl

Member
Licensed User
Longtime User
It's fantastic thanks
Is there any focus property? Like Setfocus to open keyboard in programming
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Amazing view indeed.
I have a question, though: The PasswordRevealChanged event is passing True when the text field is hidden, while on the other hand it´s passing False when the text is shown. The Reveale property reflects this - which is expected.
In other words: If your text is hidden and you get the Reveale property, you're gonna get the value True, opposed to the actual view state.
Is this the intended behaviour?

By the way, maybe you might change Reveale property name to Revealed.

Apart from this, congrats for the view. Amazing as usual!
 

behnam_tr

Active Member
Licensed User
Longtime User
Hi @Alexander Stolte

Error On b4j 9.30

B4X:
Waiting for debugger to connect...
Program started.
Error occurred on line: 229 (AS_TextFieldAdvanced)
java.lang.RuntimeException: Type does not match (class javafx.scene.control.TextField)
    at anywheresoftware.b4a.objects.B4XViewWrapper.typeDoesNotMatch(B4XViewWrapper.java:573)
    at anywheresoftware.b4a.objects.B4XViewWrapper.SetTextAlignment(B4XViewWrapper.java:448)
    at b4j.example.as_textfieldadvanced._designercreateview(as_textfieldadvanced.java:1627)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:109)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4j.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:79)
    at anywheresoftware.b4j.objects.LayoutBuilder.loadLayout(LayoutBuilder.java:110)
    at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:101)
    at b4j.example.main._appstart(main.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:109)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:96)
    at b4j.example.main.start(main.java:38)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
    at java.lang.Thread.run(Thread.java:750)
 

james_sgp

Active Member
Licensed User
Longtime User
I have 2 fields for 'passwords' but unless I tap the 'reveal' buttons I`m they are returning as empty:

B4X:
    If reg_pass.Text = "" Or reg_pass2.Text = "" Then
        MsgboxAsync("Please enter PASSWORDS", "E R R O R")
        Return

Can someone let me know what I`m doing wrong...

James
 

james_sgp

Active Member
Licensed User
Longtime User
Update
  • 1.15
    • BugFix

Thanks for reporting, have a nice day!
Mmm....now its telling me that other boxes have no text (default, no password, icons, etc):

B4X:
    If reg_name.Text = "" Then
        MsgboxAsync("Please enter a NAME", "E R R O R")
        Return
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…