tags:

views:

676

answers:

0

Hello every thanks for supporting me for my last question Form getting submitted even A4j validation fails +jsf it is working

i have selectonemenu for country list if the user is selecting country other than india he will directly enter state in textbox but if he selects india another selectonemenu appears.

but on selecting value from selectonemenu nothing happens none of the inputtext or selectonemenu enable/disable

here is my code

    private boolean showText=false;
private boolean showSelect=false;

public boolean isShowText() {
 return showText;
}

public void setShowText(boolean showText) {
 this.showText = showText;
}

public boolean isShowSelect() {
 return showSelect;
}

public void setShowSelect(boolean showSelect) {
 this.showSelect = showSelect;
}

public void checkCountry(FacesContext facesContext, UIComponent component, Object value) throws Exception {

 String countryName=(String)value;  
 if(countryName.equalsIgnoreCase("India")){
  setShowText(false);
  setShowSelect(true);
 }else{
  setShowText(true);
  setShowSelect(false);
 }
}

could any one suggest me where i went wrong

thanks in advance