I have tried GWTP over the past few weeks and have been creating a small project with it.
Here's the question:
I have a grid widget (attached screenshot) that shows a list of data. When I select the line checkbox and click on Edit Request , I get to the details page. 
Since I have all the data (model) that will be shown on the details page in the very view of the final screen, I do not want to retrieve it from the database again.
So, I did the following:
- When I select and click on the edit request, I get the selected model
- Request a place on the details page
- Fire a
edit event and pass the selected model as a parameter.
I understand that I am doing this wrong, because when I select an item and click Edit Request , the details page does not yet receive the selected item. It simply shows a blank page without filling in the data (obviously, because the place was reached long before the event was fired).
Current code:
RequestModel selectedItem = getView().getGrid().getSelectionModel().getSelectedItem(); PlaceRequest placeRequest=new PlaceRequest(NameTokens.initiationedit); getEventBus().fireEvent(new RequestEditEvent(selectedItem, PHASE_INITIATION)); placeManager.revealPlace(placeRequest);
Personally conceivable solution . Instead of triggering an event, I could do a placerequest with the parameter of the selected id element, and then override useManualReveal and prepareFromRequest to retrieve data from the database.
But is there a way to avoid calling the database for pre-existing data.
source share