How to update value in Edit screen?

I created the “Get data from other system” button in the edit screen. The system will through the TCPIP to get the data after user click the button. But I don’t know how to updated the edit screen value.

Hey!

@Named(<idComponent to XML>)
protected <ComponentType> component
...

add to pressButtonMethod
...
component.setValue(someValue);
...

image
image

image

If cldfdDs.refresh() ran, the system will occurred errors. So I don’t how to updated the value of fields in edit screen and refresh the data to show for user. Please help me to solve the above problem. Thanks.

2018-01-15 22:44:50.849 ERROR [http-nio-9080-exec-71/app/admin] com.haulmont.cuba.web.log.AppLog - 
Exception in com.haulmont.cuba.web.toolkit.ui.CubaButton: 
com.vaadin.server.ServerRpcManager$RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:160) ~[vaadin-server-7.7.10.cuba.9.jar:7.7.10.cuba.9]
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:119) ~[vaadin-server-7.7.10.cuba.9.jar:7.7.10.cuba.9]
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:444) [vaadin-server-7.7.10.cuba.9.jar:7.7.10.cuba.9]
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:409) [vaadin-server-7.7.10.cuba.9.jar:7.7.10.cuba.9]
	at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274) [vaadin-server-7.7.10.cuba.9.jar:7.7.10.cuba.9]
	at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90) [vaadin-server-7.7.10.cuba.9.jar:7.7.10.cuba.9]

Please refer to the attached file for project.test.7z (9.2 MB)

As far as I see from the app.log file there is an error in your code:

Caused by: java.lang.RuntimeException: Error : 
	at com.company.spdbhkbz.web.cldfd.CLDFDEdit.getDataFromOBSProcess(CLDFDEdit.java:105) ~[app-web-0.1-SNAPSHOT.jar:na]
	... 60 common frames omitted
Caused by: java.lang.NullPointerException: null
	at com.company.spdbhkbz.web.cldfd.CLDFDEdit.getDataFromOBSProcess(CLDFDEdit.java:98) ~[app-web-0.1-SNAPSHOT.jar:na]
	... 60 common frames omitted

Probably, this means that your services are not injected:

2018-01-15 22:44:44.463 WARN  [http-nio-9080-exec-25] com.haulmont.cuba.gui.ControllerDependencyInjector - CDI - Unable to find an instance of type 'class com.spdbhk.cuba.ihubServices' named 'ihubservices' for instance of 'com.company.spdbhkbz.web.cldfd.CLDFDEdit'
2018-01-15 22:44:44.464 WARN  [http-nio-9080-exec-25] com.haulmont.cuba.gui.ControllerDependencyInjector - CDI - Unable to find an instance of type 'class com.spdbhk.cuba.docxServices' named 'docxservices' for instance of 'com.company.spdbhkbz.web.cldfd.CLDFDEdit'
2018-01-15 22:44:44.465 WARN  [http-nio-9080-exec-25] com.haulmont.cuba.gui.ControllerDependencyInjector - CDI - Unable to find an instance of type 'interface com.haulmont.cuba.gui.data.CollectionDatasource' named 'cldfdDs' for instance of 'com.company.spdbhkbz.web.cldfd.CLDFDEdit'

Unfortunately, I cannot even run your application. Please make your question relevant to others. Describe your question in a general way, so that more community members could benefit from the response.

Please, do not attach your real projects! If you want to illustrate the problem create a small demo with HSQL DB and without your project specifics.

See also https://www.cuba-platform.com/discuss/guidelines

If you need additional assistance we provide Commercial support https://cuba-platform.com/support-options

The problem had fixed after I added @Named("fieldGroup.name") in the updated field. But I will consider to buy the commercial support in the future.