giahai2k
(Ngô Gia Hải)
#1
how do when i type usertxt = user.login and it populates the fields Name , email,…
@Subscribe("usertxt")
protected void onUsertxtValueChange(HasValue.ValueChangeEvent<String> event) {
String nametxt = event.getValue();
User user = null;
if(user != null){
nameungvienField.setValue(user);
}
}
albudarov
(Alexander Budarov)
#2
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.
…
giahai2k
(Ngô Gia Hải)
#3
no i want my nametxt to be able to receive data from sql
albudarov
(Alexander Budarov)
#4
Then you have to:
- Create Middleware service
- Implement some method. Call JPQL or Native SQL query in this service.
- Inject service to the screen controller
- Call that method to get loaded data, where necessary.
See:
https://www.jmix.io/cuba-platform/guides/create-business-logic-in-cuba
https://doc.cuba-platform.com/manual-7.2/nativeQuery.html
1 Like