Search in sources :

Example 1 with UpdatePageFailure

use of com.willshex.blogwt.client.api.page.event.UpdatePageEventHandler.UpdatePageFailure in project blogwt by billy1380.

the class PageController method updatePage.

/**
 * @param page
 */
public void updatePage(Page page) {
    final UpdatePageRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new UpdatePageRequest())).page(page);
    ApiHelper.createPageClient().updatePage(input, new AsyncCallback<UpdatePageResponse>() {

        @Override
        public void onSuccess(UpdatePageResponse output) {
            if (output.status == StatusType.StatusTypeSuccess) {
            }
            DefaultEventBus.get().fireEventFromSource(new UpdatePageSuccess(input, output), PageController.this);
        }

        @Override
        public void onFailure(Throwable caught) {
            DefaultEventBus.get().fireEventFromSource(new UpdatePageFailure(input, caught), PageController.this);
        }
    });
}
Also used : UpdatePageResponse(com.willshex.blogwt.shared.api.page.call.UpdatePageResponse) UpdatePageRequest(com.willshex.blogwt.shared.api.page.call.UpdatePageRequest) UpdatePageFailure(com.willshex.blogwt.client.api.page.event.UpdatePageEventHandler.UpdatePageFailure) UpdatePageSuccess(com.willshex.blogwt.client.api.page.event.UpdatePageEventHandler.UpdatePageSuccess)

Aggregations

UpdatePageFailure (com.willshex.blogwt.client.api.page.event.UpdatePageEventHandler.UpdatePageFailure)1 UpdatePageSuccess (com.willshex.blogwt.client.api.page.event.UpdatePageEventHandler.UpdatePageSuccess)1 UpdatePageRequest (com.willshex.blogwt.shared.api.page.call.UpdatePageRequest)1 UpdatePageResponse (com.willshex.blogwt.shared.api.page.call.UpdatePageResponse)1