Calling the Composite GWT Method from Another Composite

I am new to GWT and am trying to create a simple application (e.g. a small version of fmylife). So far I have created a composite that downloads facts and another composite that has a form for presenting new facts (this has a loading method that clears the list and fills it again).

I have a button that when I click on it displays a window with a form. This form is used to add new facts. But I want to refresh the main page when the Fact is added correctly and closes this window.

How should I do it? Should I pass any callback to window form?

Edit: I have not expressed enough Window- this DialogBoxis provided by smartGWT .

+3
source share
4 answers

See Events and the event bus .

You can also watch this video for a better explanation.

+2
source

Of course, why not? Pass the callback using some method, such as onSave, to the composite element contained in the DialogBox. Create the stream so that the DialogBox composite always edits the fact model, and it does not know if it creates a new fact model or edits an existing one. Let DialogBox call onSave using a callback when the user sends a popup.

CRUD DialogBox.

+1

DialogBox PopupPanel , ( ). , ( AJAX, ?), , "submit" / ( ).

0

DialogBox PopupPanel. , Window, .

Extend Windowand provide bindings to the values ​​you want to return. Then, when you create a new one CustomWindow, call the method addWindowCloseHandlerto get a notification when it CusomWindowcloses. In this case, get the desired values ​​and let me close the window. Then make an asynchronous call to refresh the main page.

0
source

Source: https://habr.com/ru/post/1755394/


All Articles