B4J Question B4J and validation controls.

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
After creating some tools with B4J I felt need for have validation components.

The idea is to create validators controls using CustomView. Controls similar to visual studio controls.

RequiredFieldValidator
CompareValidator
RangeValidator
RegularExpressionValidator
CustomValidator

You would think this useful?

Why am I asking? Do not reinvent the wheel.

Thanks for opinions.
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User

Attachments

  • validator.zip
    2.3 KB · Views: 224
Upvote 0

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
Thank you. I'll read the documentation.

I thought about creating codes like this and embarks them on a CustomView class.
So it could be used with BJ4 in visual design in super easy way.
But it seems that people don´t think it´s relevant.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use jControlsFX: https://www.b4x.com/android/forum/threads/controlsfx-library.50700/

Or with a simple TextField and CSSUtils:

B4X:
Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
   Private tf As TextField
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.Show
   tf.Initialize("tf")
   MainForm.RootPane.AddNode(tf, 10, 10, 300, 50)
End Sub

Sub tf_TextChanged (Old As String, New As String)
   If IsNumber(New) = False Then
     CSSUtils.SetBorder(Sender, 2, fx.Colors.Red, 2)
   Else
     CSSUtils.SetBorder(Sender, 0, fx.Colors.Transparent, 0)
   End If
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…