/** Create the UI for the panel */ protected void createUI() { createForm("Preferences", "LoansPrefs"); AppPreferences prefs = AppPreferences.getRemote(); Integer dueInMonths = prefs.getInt(DUEINMONTHS, 6); String shippingMethod = prefs.get(LoanGiftShipmentBusRules.SHIPMETHOD, null); Integer shippedByAgentId = prefs.getInt(LoanGiftShipmentBusRules.SHIPPEDBY, null); FormViewObj fvo = (FormViewObj) form; ValSpinner dueSpinner = fvo.getCompById("OVERDUETIME"); if (dueSpinner != null) { dueSpinner.setValue(dueInMonths); } ValComboBox shipMeth = fvo.getCompById("SHIPMETH"); if (shipMeth != null) { shipMeth.setValue(shippingMethod, null); } ValComboBoxFromQuery shippedBy = fvo.getCompById("SHIPPEDBY"); if (shippedBy != null && shippedByAgentId != null) { DataProviderSessionIFace session = null; try { session = DataProviderFactory.getInstance().createSession(); Agent agent = session.get(Agent.class, shippedByAgentId); shippedBy.setValue(agent, null); } catch (Exception ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance() .capture(ValComboBoxFromQuery.class, ex); ex.printStackTrace(); } finally { if (session != null) { session.close(); } } } }