public IPage editService(IRequestCycle cycle, String serviceBeanId, Integer locationId) { PageWithCallback page = (PageWithCallback) cycle.getPage(SERVICE_MAP.get(serviceBeanId)); page.setReturnPage(EditLocationPage.PAGE); if (page instanceof AcdServerPage) { AcdServer acdServer = getAcdContext().getAcdServerForLocationId(locationId); if (acdServer != null) { ((AcdServerPage) page).setAcdServerId(acdServer.getId()); } } return page; }