-
1. Re: Richfaces 4.0 autocomplete
vadivelcit Oct 31, 2011 7:37 AM (in response to vadivelcit)Hi All,
here i will explain the above issue clearly
step1: When I click on submit button with empty fields, validation is working (which ever field is required). pls see the image1
step2: Then type on the company field, all the error message will be disappear (company field is <rich:autocomplete>).
pls see the image2
I want all the error message should be appear, (when I type on the company field).
I used <a4j:regin>. but i didnt get anything.
-
2. Re: Richfaces 4.0 autocomplete
vadivelcit Nov 3, 2011 7:02 AM (in response to vadivelcit)tis is my code:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
<h:form id="form-id">
name<br />
<h:inputText id="name" value="#{testBean.name}" required="true"
requiredMessage="value is required"/>
<rich:message for="name" />
phone number<br />
<h:inputText id="phone-num" value="#{testBean.phoneNumber}" required="true"
requiredMessage="value is required"/>
<rich:message for="phone-num" />
company<br />
<rich:autocomplete id="com-id" value="#{testBean.company}"
autocompleteMethod="#{testBean.companyList}"
fetchValue="#{company.label}" var="company" required="true"
mode="ajax" minChars="1" requiredMessage="value is required">
<h:outputText value="#{company.label}" />
</rich:autocomplete>
<rich:message for="com-id" />
Address<br />
<h:inputText id="add" value="#{testBean.address}" required="true"
requiredMessage="value is required"/>
<rich:message for="add" />
<a4j:commandButton type="submit" action="#{testBean.save}" value="submit" />
</h:form>
</html>
managed bean:
@ManagedBean
@ViewScoped
public class TestBean implements Serializable{
private static final long serialVersionUID = 1L;
private String name;
private String phoneNumber;
private String company;
private String address;
private List<String> clist;
public TestBean() {}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public List<String> getClist() {
return clist;
}
public void setClist(List<String> clist) {
this.clist = clist;
}
public List<String> companyList() {
clist = new ArrayList<String>();
clist.add("1test1");
clist.add("1test2");
clist.add("2test1");
clist.add("2test2");
clist.add("3test1");
clist.add("3test2");
clist.add("4test1");
clist.add("4test2");
return clist;
}
public void save() {
}
}