B4J Question Source for this password example

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I've looked at all the examples (I could find) and cannot find the source for this password example

Password Example

1620573061839.png


Would be nice if the code was right there for cutting and pasting. I know I am lazy but first time using on B4J
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
This is what I am trying to do.

This code works fine but the password shows when typing it in.

Seems I need to create a designer file for just this one field use ONLY Once at startup - WOW is this lame or what.

WHY are we being forced to create a designer file just to set these field properties - I fine that this such a design flaw.

SORRY, I just don't want to do my coding in designer and it seems like we are being forced that way if we want to use any of the new features.

These are some great features, but we should be able to set them in code for quick use.

OR maybe we can and I just don't know how.

B4X:
Private Sub GetPassword As ResumableSub 
    
               Dim password        As B4XInputTemplate

            Try
                Do While True           
                      password.Initialize
                       password.lblTitle.Text = "Enter Password:"
            
                       Wait For (Dialog.ShowTemplate(password, "OK", "", "CANCEL")) Complete (Result As Int)
            
                       If     Result = xui.DialogResponse_Positive Then
                           If  DecryptText(PasswordMatch, password.Text) = password.text Then
                            Return True
                        End If
                    Else
                        Exit
                       End If
                Loop
            Catch
                Log(LastException.Message)
            End Try
            
            Return False
End Sub
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
I've looked at all the examples (I could find) and cannot find the source for this password example

Password Example

View attachment 113089

Would be nice if the code was right there for cutting and pasting. I know I am lazy but first time using on B4J
see:
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Seems I need to create a designer file for just this one field use ONLY Once at startup - WOW is this lame or what.

WHY are we being forced to create a designer file just to set these field properties - I fine that this such a design flaw.

SORRY, I just don't want to do my coding in designer and it seems like we are being forced that way if we want to use any of the new features.
No need for too much drama. It is very simple to create a layout file with the field and load it whenever you need: [B4X] I need 100 <custom view here>s. How to add programmatically?

Another option is to take the source code from the b4xlib (=zip) and make it work exactly as you want.

There are many advantages to building the layout with the designer, especially if you are building cross platform solutions.
It is also simpler to build custom views that are created by the designer.
 
Upvote 0
Top