protected void exportForm(FormRepresentation form) { FormRepresentationEncoder encoder = FormEncodingFactory.getEncoder(); try { String formAsJson = encoder.encode(form); setClientExportForm(formAsJson); } catch (FormEncodingException e) { bus.fireEvent(new NotificationEvent(Level.ERROR, i18n.CouldntExportAsJson(), e)); } }