private void displayReport() { errorText.setInnerText(""); purposeText.setText(report.getPurpose()); notesText.setText(report.getNotes()); String department = report.getDepartment(); departmentList.setSelectedIndex(0); for (int i = 0; i < Expenses.DEPARTMENTS.length; i++) { if (Expenses.DEPARTMENTS[i].equals(department)) { departmentList.setSelectedIndex(i); } } Date d = report.getCreated(); showCreationDate(d); }
public void create(EmployeeProxy reporter) { request = requestFactory.reportRequest(); report = request.create(ReportProxy.class); request.persist().using(report); report.setReporter(reporter); displayReport(); }
@SuppressWarnings("deprecation") public void onCustom() { ReportProxy editableReport = request.edit(report); editableReport.setPurpose(purposeText.getText()); editableReport.setNotes(notesText.getText()); editableReport.setDepartment(departmentList.getValue(departmentList.getSelectedIndex())); // TODO(jgw): Use non-deprecated date methods for this. Date date = new Date( dateYear.getSelectedIndex() + 100, dateMonth.getSelectedIndex(), dateDay.getSelectedIndex() + 1); editableReport.setCreated(date); // TODO: wait throbber request.fire( new Receiver<Void>() { @Override public void onSuccess(Void ignore) {} // use onViolations to check for ConstraintViolations. }); }
public String getPageTitle() { return report != null ? report.getPurpose() : ""; }