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

With this view you can quickly and easily add good looking text fields, with title and or bottom text. Additionally you can make the TextField a button, so that you can open menus, but still keep the design of the text fields.
The view speeds up development because you don't have to worry about almost anything, it looks nice by default and is functional.

I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee. :)

In B4J the view does not work properly yet, I am working on fixing the bugs. B4J works now
(21) mage.png

ASTextFieldAdvanced
Author: Alexander Stolte
Version: 1.07

  • ASTextFieldAdvanced_Counter
    • Fields:
      • CounterMax As Int
      • IgnoreProperties As Boolean
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • TextColor As Int
      • View As ASTextFieldAdvanced_ViewCounter
      • Visible As Boolean
      • xFont As B4XFont
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_Hint
    • Fields:
      • FocusedTextColor As Int
      • IgnoreProperties As Boolean
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • NonFocusedTextColor As Int
      • Text As String
      • View As ASTextFieldAdvanced_ViewHint
      • Visible As Boolean
      • xFont As B4XFont
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_Information
    • Fields:
      • IgnoreProperties As Boolean
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Text As String
      • TextColor As Int
      • View As ASTextFieldAdvanced_ViewInformation
      • Visible As Boolean
      • xFont As B4XFont
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_LeadingIcon
    • Fields:
      • Icon As B4XBitmap
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • View As ASTextFieldAdvanced_ViewLeadingIcon
      • Visible As Boolean
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_Prefix
    • Fields:
      • Gap As Float
      • IgnoreProperties As Boolean
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Text As String
      • TextColor As Int
      • View As ASTextFieldAdvanced_ViewPrefixSuffix
      • Visible As Boolean
      • xFont As B4XFont
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_Suffix
    • Fields:
      • Gap As Float
      • IgnoreProperties As Boolean
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Text As String
      • TextColor As Int
      • View As ASTextFieldAdvanced_ViewPrefixSuffix
      • Visible As Boolean
      • xFont As B4XFont
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_Title
    • Fields:
      • Height As Float
      • IgnoreProperties As Boolean
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Text As String
      • TextColor As Int
      • View As ASTextFieldAdvanced_ViewTitle
      • Visible As Boolean
      • xFont As B4XFont
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_TrailingIcon
    • Fields:
      • Icon As B4XBitmap
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • View As ASTextFieldAdvanced_ViewTrailingIcon
      • Visible As Boolean
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_ViewCounter
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • xlbl_Counter As B4XView
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_ViewHint
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • xlbl_Hint As B4XView
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_ViewInformation
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • xlbl_Information As B4XView
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_ViewLeadingIcon
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • xiv_Icon As B4XView
      • xpnl_Background As B4XView
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_ViewPrefixSuffix
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • xlbl_PrefixSuffix As B4XView
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_ViewTitle
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • xlbl_Title As B4XView
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASTextFieldAdvanced_ViewTrailingIcon
    • Fields:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • xiv_Icon As B4XView
      • xpnl_Background As B4XView
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • AS_TextFieldAdvanced
    • Events:
      • ButtonClick
      • EnterPressed
      • FocusChanged (HasFocus As Boolean)
      • LeadingIconClick
      • PasswordRevealChanged (Revealed As Boolean)
      • TextChanged (Text As String)
      • TrailingIconClick
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • Class_Globals As String
      • CreateASTextFieldAdvanced_Counter (Visible As Boolean, CounterMax As Int, IgnoreProperties As Boolean, xFont As B4XFont, TextColor As Int, View As ASTextFieldAdvanced_ViewCounter) As ASTextFieldAdvanced_Counter
      • CreateASTextFieldAdvanced_Hint (Visible As Boolean, Text As String, IgnoreProperties As Boolean, FocusedTextColor As Int, NonFocusedTextColor As Int, xFont As B4XFont, View As ASTextFieldAdvanced_ViewHint) As ASTextFieldAdvanced_Hint
      • CreateASTextFieldAdvanced_Information (Visible As Boolean, Text As String, IgnoreProperties As Boolean, xFont As B4XFont, TextColor As Int, View As ASTextFieldAdvanced_ViewInformation) As ASTextFieldAdvanced_Information
      • CreateASTextFieldAdvanced_LeadingIcon (Visible As Boolean, Icon As B4XBitmap, View As ASTextFieldAdvanced_ViewLeadingIcon) As ASTextFieldAdvanced_LeadingIcon
      • CreateASTextFieldAdvanced_Prefix (Visible As Boolean, Text As String, IgnoreProperties As Boolean, xFont As B4XFont, TextColor As Int, Gap As Float, View As ASTextFieldAdvanced_ViewPrefixSuffix) As ASTextFieldAdvanced_Prefix
      • CreateASTextFieldAdvanced_Suffix (Visible As Boolean, Text As String, IgnoreProperties As Boolean, xFont As B4XFont, TextColor As Int, Gap As Float, View As ASTextFieldAdvanced_ViewPrefixSuffix) As ASTextFieldAdvanced_Suffix
      • CreateASTextFieldAdvanced_Title (Visible As Boolean, Text As String, Height As Float, IgnoreProperties As Boolean, xFont As B4XFont, TextColor As Int, View As ASTextFieldAdvanced_ViewTitle) As ASTextFieldAdvanced_Title
      • CreateASTextFieldAdvanced_TrailingIcon (Visible As Boolean, Icon As B4XBitmap, View As ASTextFieldAdvanced_ViewTrailingIcon) As ASTextFieldAdvanced_TrailingIcon
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • getBackgroundColor As Int
      • getBackgroundPanel As B4XView
      • getBottomHeight As Float
        Call Refresh if you change something
      • getButtonTextLabel As B4XView
      • getClearButtonLabel As B4XView
      • getCounter As ASTextFieldAdvanced_Counter
        Call Refresh if you change something
      • getHint As ASTextFieldAdvanced_Hint
        Call Refresh if you change something
      • getInformation As ASTextFieldAdvanced_Information
        Call Refresh if you change something
      • getisPasswordMode As Boolean
      • getKeyboardType As String
      • getLeadingIcon As ASTextFieldAdvanced_LeadingIcon
        Call Refresh if you change something
      • getLeftGap As Float
        Default: 10dip
        Call Refresh if you change something
      • getNativeTextField As TextField
        Gets the native TextField view
      • getNativeTextFieldMultiline As TextArea
      • getNativeTextFieldPassword As TextField
        Gets the native TextField view
      • getPrefix As ASTextFieldAdvanced_Prefix
        Call Refresh if you change something
      • getReadOnly As Boolean
      • getRevealButtonLabel As B4XView
      • getReveale As Boolean
      • getShowClearButton As Boolean
        Call Refresh if you change something
      • getShowRevealButton As Boolean
        Call Refresh if you change something
      • getSuffix As ASTextFieldAdvanced_Suffix
        Call Refresh if you change something
      • getText As String
      • getTextField As B4XView
      • getTextFieldMultiline As B4XView
      • getTextFieldPassword As B4XView
      • getTextFull As String
        Gets the full text, with Prefix and Suffix
      • getTitle As ASTextFieldAdvanced_Title
        Call Refresh if you change something
      • getTrailingIcon As ASTextFieldAdvanced_TrailingIcon
        Call Refresh if you change something
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Refresh As String
      • setBackgroundColor (Color As Int) As String
      • setBottomHeight (Height As Float) As String
      • setButtonText (Text As String) As String
      • setLeftGap (Gap As Float) As String
      • setReadOnly (ReadOnly As Boolean) As String
      • setReveale (Revealed As Boolean) As String
      • setShowClearButton (Show As Boolean) As String
      • setShowRevealButton (Show As Boolean) As String
      • setText (Text As String) As String
    • Properties:
      • BackgroundColor As Int
      • BackgroundPanel As B4XView [read only]
      • BottomHeight As Float
        Call Refresh if you change something
      • ButtonText
      • ButtonTextLabel As B4XView [read only]
      • ClearButtonLabel As B4XView [read only]
      • Counter As ASTextFieldAdvanced_Counter [read only]
        Call Refresh if you change something
      • Hint As ASTextFieldAdvanced_Hint [read only]
        Call Refresh if you change something
      • Information As ASTextFieldAdvanced_Information [read only]
        Call Refresh if you change something
      • isPasswordMode As Boolean [read only]
      • KeyboardType As String [read only]
      • LeadingIcon As ASTextFieldAdvanced_LeadingIcon [read only]
        Call Refresh if you change something
      • LeftGap As Float
        Default: 10dip
        Call Refresh if you change something
      • NativeTextField As TextField [read only]
        Gets the native TextField view
      • NativeTextFieldMultiline As TextArea [read only]
      • NativeTextFieldPassword As TextField [read only]
        Gets the native TextField view
      • Prefix As ASTextFieldAdvanced_Prefix [read only]
        Call Refresh if you change something
      • ReadOnly As Boolean
      • RevealButtonLabel As B4XView [read only]
      • Reveale As Boolean
      • ShowClearButton As Boolean
        Call Refresh if you change something
      • ShowRevealButton As Boolean
        Call Refresh if you change something
      • Suffix As ASTextFieldAdvanced_Suffix [read only]
        Call Refresh if you change something
      • Text As String
      • TextField As B4XView [read only]
      • TextFieldMultiline As B4XView [read only]
      • TextFieldPassword As B4XView [read only]
      • TextFull As String [read only]
        Gets the full text, with Prefix and Suffix
      • Title As ASTextFieldAdvanced_Title [read only]
        Call Refresh if you change something
      • TrailingIcon As ASTextFieldAdvanced_TrailingIcon [read only]
        Call Refresh if you change something
Changelog
  • 1.00
    • Release
  • 1.01 (read more)
    • Add Designer Property LeadingIcon - An icon which is placed in front of the text and has its own click event
    • Add Designer Property TrailingIcon - An icon which is placed behind the text and has its own click event
    • Add Event LeadingIconClick
    • Add Event TrailingIconClick
    • Add some more properties
  • 1.02
    • Add Type ASTextFieldAdvanced_Title
    • Add Type ASTextFieldAdvanced_Information
    • Add Type ASTextFieldAdvanced_Counter
    • Add Type ASTextFieldAdvanced_Hint
    • Add Type ASTextFieldAdvanced_LeadingIcon
    • Add Type ASTextFieldAdvanced_TrailingIcon
    • Removed some properties, they are now in the new types
    • BugFixes
  • 1.03 (read more)
    • Add Type ASTextFieldAdvanced_Prefix
    • Add Type ASTextFieldAdvanced_Suffix
    • Add Designer Properties Prefix, PrefixText, Suffix, SuffixText
    • Add get TextFull - Gets the full text, with Prefix and Suffix
    • BugFixes
  • 1.04
    • BugFixes
  • 1.05
    • BugFixes
  • 1.06
    • BugFixes
    • Add Designer Property ReadOnly - Disables the user input
      • Default: False
  • 1.07
    • BugFixes
    • Add "Multiline" to the designer property "Mode"
    • New Multiline mode
Have Fun :)
 

Attachments

  • AS TextFieldAdvanced Example.zip
    96.5 KB · Views: 29
  • AS_TextFieldAdvanced.b4xlib
    7.4 KB · Views: 32
Last edited:

behnam_tr

Active Member
Licensed User
thanks @Alexander Stolte

There is an error during execution b4j 9.50

B4X:
Waiting for debugger to connect...
Program started.
java.lang.NullPointerException
    at anywheresoftware.b4a.objects.B4XViewWrapper$XUI.PaintOrColorToColor(B4XViewWrapper.java:964)
    at b4j.example.as_textfieldadvanced._iniprops(as_textfieldadvanced.java:640)
    at b4j.example.as_textfieldadvanced._designercreateview(as_textfieldadvanced.java:408)
    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:111)
    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 anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:506)
    at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:153)
    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.debug.Debug.CallSub4(Debug.java:115)
    at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:81)
    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.keywords.Common.CallSubDebug2(Common.java:487)
    at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:875)
    at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:354)
    at b4j.example.b4xpagesmanager._addpage(b4xpagesmanager.java:175)
    at b4j.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:189)
    at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:125)
    at b4j.example.main._appstart(main.java:85)
    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:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    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:186)
    at java.lang.Thread.run(Thread.java:748)
Error occurred on line: 229 (AS_TextFieldAdvanced)
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
Awesome, please consider adding both prepend & append icons, these can be clickable.
For example, an append icon when clicked, can show a "Description/Tooltip".
A prepend icon, assuming that one can adopt this to be used with a color picker, should be used to show the color chosen, perhaps that could be better with a prepend-inner-icon I guess just like the append-inner-icon you have here. #SomeThoughts.

Awesome stuff already congratulations.
 

Alexander Stolte

Expert
Licensed User
For example, an append icon when clicked, can show a "Description/Tooltip".
A prepend icon, assuming that one can adopt this to be used with a color picker, should be used to show the color chosen, perhaps that could be better with a prepend-inner-icon I guess just like the append-inner-icon you have here. #SomeThoughts.
Yes is planned, but can not yet say when I will find time for it.

Prefix and suffix will also come.

Awesome stuff already congratulations.
Thank you very much :)
 

Alexander Stolte

Expert
Licensed User
Update
  • 1.01
    • Add Designer Property LeadingIcon - An icon which is placed in front of the text and has its own click event
    • Add Designer Property TrailingIcon - An icon which is placed behind the text and has its own click event
    • Add Event LeadingIconClick
    • Add Event TrailingIconClick
    • Add some more properties
B4X:
AS_TextFieldAdvanced_4.LeadingIcon.Icon = xui.LoadBitmap(File.DirAssets,"search.png")
AS_TextFieldAdvanced_4.TrailingIcon.Icon = xui.LoadBitmap(File.DirAssets,"warning.png")
    
AS_TextFieldAdvanced_4.LeftGap = 0
AS_TextFieldAdvanced_4.Refresh
(20) mage2.png
 
Last edited:

Alexander Stolte

Expert
Licensed User
In this update I have better structured the properties and packed them into their own types. So you can find all properties of a module bundled in their own type.

I have updated the Example Project.
Update
  • 1.02
    • Add Type ASTextFieldAdvanced_Title
    • Add Type ASTextFieldAdvanced_Information
    • Add Type ASTextFieldAdvanced_Counter
    • Add Type ASTextFieldAdvanced_Hint
    • Add Type ASTextFieldAdvanced_LeadingIcon
    • Add Type ASTextFieldAdvanced_TrailingIcon
    • Removed some properties, they are now in the new types
    • BugFixes
 

Alexander Stolte

Expert
Licensed User
Update
  • 1.03
    • Add Type ASTextFieldAdvanced_Prefix
    • Add Type ASTextFieldAdvanced_Suffix
    • Add Designer Properties Prefix, PrefixText, Suffix, SuffixText
    • Add get TextFull - Gets the full text, with Prefix and Suffix
    • BugFixes
B4X:
'Prefix Suffix Example
AS_TextFieldAdvanced_5.LeftGap = 0
AS_TextFieldAdvanced_5.TextField.SetTextAlignment("CENTER","RIGHT")
AS_TextFieldAdvanced_5.Hint.View.xlbl_Hint.SetTextAlignment("CENTER","RIGHT")
AS_TextFieldAdvanced_5.Prefix.Text = "$"
AS_TextFieldAdvanced_5.Suffix.Text = "@gmail.com"
AS_TextFieldAdvanced_5.Refresh
r6PyIEFNa3pRVYq3JZQE5LlPFqpT9nQoRxJOrzG3ROctwmAedE.jpeg
 

pliroforikos

Active Member
Licensed User
I have a problem when i use 3 text fields in a form. I made a form with 3 AS_Fields. When i use bal file with a B4XPage it works but when i use it in a panel it shows

** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
as_textfieldadvanced_textchanged (java line: 1589)
java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:89)
at anywheresoftware.b4a.objects.B4XViewWrapper.setVisible(B4XViewWrapper.java:115)
at b4a.myDialog.as_textfieldadvanced._textchanged(as_textfieldadvanced.java:1589)
at b4a.myDialog.as_textfieldadvanced._xtf_textfield_textchanged(as_textfieldadvanced.java:1689)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.objects.EditTextWrapper$1.afterTextChanged(EditTextWrapper.java:83)
at android.widget.TextView.sendAfterTextChanged(TextView.java:8267)
at android.widget.TextView.setText(TextView.java:4553)
at android.widget.TextView.setText(TextView.java:4343)
at android.widget.EditText.setText(EditText.java:89)
at android.widget.TextView.setText(TextView.java:4318)
at android.widget.TextView.setTransformationMethod(TextView.java:1942)
at android.widget.TextView.applySingleLine(TextView.java:7948)
at android.widget.TextView.setSingleLine(TextView.java:7923)
at anywheresoftware.b4a.objects.EditTextWrapper.setSingleLine(EditTextWrapper.java:140)
at b4a.myDialog.as_textfieldadvanced._createtextfield(as_textfieldadvanced.java:867)
at b4a.myDialog.as_textfieldadvanced._designercreateview(as_textfieldadvanced.java:916)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:67)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:312)
at b4a.myDialog.b4xmainpage$ResumableSub_showDialog2.resume(b4xmainpage.java:270)
at b4a.myDialog.b4xmainpage._showdialog2(b4xmainpage.java:230)
at b4a.myDialog.b4xmainpage._button2_click(b4xmainpage.java:68)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5653)
at android.view.View$PerformClick.run(View.java:22456)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6138)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
** Activity (main) Resume **
*** pgsettings: B4XPage_Appear [pgsettings]

B4X:
    dlg2.Initialize(Root)
    dlg2.Title = textDlgTitle

    dlg2.TitleBarColor = xui.Color_RGB(83,88,143)
    dlg2.TitleBarHeight = 50dip
    dlg2.BorderColor = xui.Color_RGB(83,88,143)
    dlg2.BorderCornersRadius = 10

    Dim p As B4XView = xui.CreatePanel("")
'    p = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 350dip, 260dip)
    p.LoadLayout("dlg2")
    
    dlg2.PutAtTop = True 'put the dialog at the top of the screen
    txt1.Hint.Text = "School"
    txt2.Hint.Text = "Address"
    txt3.Hint.Text = "POB"
    txt1.Refresh
    txt2.Refresh
    txt3.Refresh

    Dim rs As ResumableSub = dlg2.ShowCustom(p, textBtnOK, textBtnNo, textBtnCancel)

    Wait For (rs) Complete (result As Int)

    If result = xui.DialogResponse_Positive Then
'        mSchool.Initialize
'        mSchool.Put("schname", txt1.Text)
'        mSchool.Put("url", txt2.Text)
'        mSchool.Put("hash", txt3.Text)
    End If
 

pliroforikos

Active Member
Licensed User
Can you please show it in an example project, thanks
In this project button1 shows a b4xDialog with 3 floatTextFields (file: dlgSchool.bal)
and button2 is trying to show the same b4xDialog with 3 ASFields (file: dlg2.bal)

Thank you
 
Last edited:

cobra666

Member
Licensed User
Longtime User
Love all the options so far.

I tested your example and found a few bugs

Bugs :

multiline not working.
with AS_TextFieldAdvanced_1. when u typ a password and press the X it forgets to clear the line. "Hint" function overlaps the password

Request : Readonly function
 

Alexander Stolte

Expert
Licensed User
multiline not working.
is not a bug, because there is no function where you can enable multiline. Multiline is not yet supported, but it is on my to-do list. :)

Update
  • 1.06
    • BugFixes
    • Add Designer Property ReadOnly - Disables the user input
      • Default: False
B4X:
AS_TextFieldAdvanced_4.ReadOnly = True
 

Alexander Stolte

Expert
Licensed User
Nice, is it possible to add a combobox with hint.
Yes, set Mode = Button
and look at this example to combine this 2 views.
With the ButtonClick Event you open the combo.
 
Top