验证错误发生后,如何使用PrimeFacesAjax填充文本字段?
@ManagedBean(name="mybean")@SessionScopedpublic class Mybean implements Serializable { private Address address; private String fullAddress; private String center = "0,0"; .... public mybean() { address = new Address(); } ... public void handleAddressChange() { String c = ""; c = (address.getAddressLine1() != null) { c += address.getAddressLine1(); } c = (address.getAddressLine2() != null) { c += ", " + address.getAddressLine2(); } c = (address.getCity() != null) { c += ", " + address.getCity(); } c = (address.getState() != null) { c += ", " + address.getState(); } fullAddress = c; addMessage(new FacesMessage(FacesMessage.SEVERITY_INFO, "Full Address", fullAddress)); try { geocodeAddress(fullAddress); } catch (MalformedURLException ex) { Logger.getLogger(Mybean.class.getName()).log(Level.SEVERE, null, ex); } catch (UnsupportedEncodingException ex) { Logger.getLogger(Mybean.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(Mybean.class.getName()).log(Level.SEVERE, null, ex); } catch (ParserConfigurationException ex) { Logger.getLogger(Mybean.class.getName()).log(Level.SEVERE, null, ex); } catch (SAXException ex) { Logger.getLogger(Mybean.class.getName()).log(Level.SEVERE, null, ex); } catch (XPathExpressionException ex) { Logger.getLogger(Mybean.class.getName()).log(Level.SEVERE, null, ex); } }
qq_花开花谢_0
MMMHUHU
相关分类