Layout Components
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
Layout Components www.icefaces.org ICESOFT TECHNOLOGIES INC. - - PowerPoint PPT Presentation
Layout Components www.icefaces.org ICESOFT TECHNOLOGIES INC. Component Naming Schemes Here is the general naming scheme for ICEfaces component tags: Layout Components: panel* Input Components: input* Output Components: output*
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
valueChangeListener="#{applicantForm.cityListener}"
public void cityListener(ValueChangeEvent valueChangeEvent) { FacesContext facesContext = FacesContext.getCurrentInstance(); UIViewRoot uiViewRoot = facesContext.getViewRoot(); String cityNameStartsWith = (String)valueChangeEvent.getNewValue(); getCitySupport().filterSelectItems(cityNameStartsWith);
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
City city = getCitySupport().getCityByName(cityNameStartsWith); if (city != null) { UIInput cityInputText = (UIInput) uiViewRoot.findComponent("applicantForm:city"); cityInputText.setSubmittedValue(city.getCityName()); cityInputText.setValue(city.getCityName()); UIInput provinceInputText = (UIInput) uiViewRoot.findComponent("applicantForm:provinceId"); provinceInputText.setSubmittedValue(Long.toString(city.getProvinceId())); provinceInputText.setValue(city.getProvinceId()); UIInput postalCodeInputText = (UIInput) uiViewRoot.findComponent("applicantForm:postalCode"); postalCodeInputText.setSubmittedValue(city.getPostalCode()); postalCodeInputText.setValue(city.getPostalCode()); FacesContextHelper.clearImmediateFacesMessages(facesContext); } }
backing bean
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
public void postalCodeListener(ValueChangeEvent valueChangeEvent) { FacesContext facesContext = FacesContext.getCurrentInstance(); UIViewRoot uiViewRoot = facesContext.getViewRoot(); String newPostalCode = (String) valueChangeEvent.getNewValue(); City city = getCitySupport().getCityByPostalCode(newPostalCode); if (city != null) { UIInput cityInputText = (UIInput) uiViewRoot.findComponent("applicantForm:city"); cityInputText.setSubmittedValue(city.getCityName()); cityInputText.setValue(city.getCityName());
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
UIInput provinceInputText = (UIInput) uiViewRoot.findComponent("applicantForm:provinceId"); provinceInputText.setSubmittedValue(Long.toString(city.getProvinceId())); provinceInputText.setValue(city.getProvinceId()); UIInput postalCodeInputText = (UIInput) uiViewRoot.findComponent("applicantForm:postalCode"); postalCodeInputText.setSubmittedValue(city.getPostalCode()); postalCodeInputText.setValue(city.getPostalCode());
FacesContextHelper.clearImmediateFacesMessages(facesContext);
} }
will work with any known postal code
<f:facet name="selectInputText">
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
<f:facet name="selectInputText"> <ice:panelGrid columns="2"> <ice:outputText id="autoCompleteCity" value="#{city.cityName}" /> <ice:outputText id="autoCompletePostalCode" value="#{city.postalCode}" /> </ice:panelGrid> </f:facet>
private long cityId; private long provinceId; private String cityName; private String postalCode;
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
public City(long cityId, long provinceId, String cityName, String postalCode) { this.cityId = cityId; this.provinceId = provinceId; this.cityName = cityName; this.postalCode = postalCode; }
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
<managed-bean> <managed-bean-name>citySupport</managed-bean-name> <managed-bean- class>training.jobapplication.bean.support.CitySupport</managed- bean-class> <managed-bean-scope>request</managed-bean-scope>
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
<!-- Inject the provinceSupport bean into the --> <!-- citySupport bean in order to promote loose coupling --> <managed-property> <property-name>provinceSupport</property-name> <value>#{provinceSupport}</value> </managed-property> </managed-bean>
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
– <ice:inputRichText toolbar="#{inputRichTextBean.toolbarMode}“ …/>
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
– <ice:inputRichText language="en" …/>
English (United Kingdom) (en-uk) Esperanto (eo) Estonian (et) Faroese (fo) Finnish (fi) Mongolian (mn) Norwegian (no) Norwegian Bokmal (nb) Persian (fa) Polish (pl) Afrikaans (af) Arabic (ar) Basque (eu) Bengali/Bangla (bn) Bosnian (bs)
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
Finnish (fi) French (fr) Galician (gl) German (de) Greek (el) Hebrew (he) Hindi (hi) Hungarian (hu) Italian (it) Japanese (ja) Khmer (km) Korean (ko) Latvian (lv) Lithuanian (lt) Malay (ms) Polish (pl) Portuguese (Brazil) (pt-br) Portuguese (Portugal) (pt) Romanian (ro) Russian (ru) Serbian (Cyrillic) (sr) Serbian (Latin) (sr-latn) Slovak (sk) Slovenian (sl) Spanish (es) Swedish (sv) Thai (th) Turkish (tr) Ukrainian (uk) Vietnamese (vi) Bosnian (bs) Bulgarian (bg) Catalan (ca) Chinese Simplified (zh-cn) Chinese Traditional (zh) Croatian (hr) Czech (cs) Danish (da) Dutch (nl) English (en) English (Australia) (en-au) English (Canadian) (en-ca)
– <ice:inputRichText skin=“office2003” …/>
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
<ice:inputRichText saveOnSubmit=“true”…/>
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
– This is some bold text
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org
ICESOFT TECHNOLOGIES INC.
www.icefaces.org