Automatically insert characters from user

how do when i type usertxt = user.login and it populates the fields Name , email,…

    protected void onUsertxtValueChange(HasValue.ValueChangeEvent<String> event) {
        String nametxt = event.getValue();
        User user = null;
        if(user != null){

If you need the event to be fired faster than the fields loses focus, you may try setTextChangeEventMode() method.

See documentation: TextField - CUBA Platform. Developer’s Manual

The TextChangeEventMode defines the way the changes are transmitted to the server to cause a server-side event. There are 3 predefined event modes:

  • LAZY (default) - an event is triggered when there is a pause in editing the text.

no i want my nametxt to be able to receive data from sql

Then you have to:

  1. Create Middleware service
  2. Implement some method. Call JPQL or Native SQL query in this service.
  3. Inject service to the screen controller
  4. Call that method to get loaded data, where necessary.


1 Like