Code/Syntax:
public void onSelectOneChoice(ValueChangeEvent valueChangeEvent) {
public void onSelectOneChoice(ValueChangeEvent valueChangeEvent) {
FacesContext.getCurrentInstance().renderResponse();
if (valueChangeEvent.getNewValue() != null &&
valueChangeEvent.getNewValue().toString().equalsIgnoreCase("Yes")) {
System.out.println("(Boolean.FALSE"+valueChangeEvent.getNewValue());
commentsITB.setValue("");
commentsITB.setRequired(Boolean.FALSE);
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
adfFacesContext.addPartialTarget(commentsITB);
}
else {
System.out.println("On Select no comments Input Text box should be "+valueChangeEvent.getNewValue());
commentsITB.resetValue();
commentsITB.setValue("");
commentsITB.setRequired(Boolean.TRUE);
}
if (valueChangeEvent.getNewValue() != null &&
valueChangeEvent.getNewValue().toString().equalsIgnoreCase("Yes")) {
System.out.println("(Boolean.FALSE"+valueChangeEvent.getNewValue());
commentsITB.setValue("");
commentsITB.setRequired(Boolean.FALSE);
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
adfFacesContext.addPartialTarget(commentsITB);
}
else {
System.out.println("On Select no comments Input Text box should be "+valueChangeEvent.getNewValue());
commentsITB.resetValue();
commentsITB.setValue("");
commentsITB.setRequired(Boolean.TRUE);
}
}
public void setCommentsITB(RichInputText commentsITB) {
this.commentsITB = commentsITB;
}
public RichInputText getCommentsITB() {
return commentsITB;
}
public void setCommentsITB(RichInputText commentsITB) {
this.commentsITB = commentsITB;
}
public RichInputText getCommentsITB() {
return commentsITB;
}
http://andrejusb.blogspot.com/2009/12/conditionally-required-fields-in-oracle.html
No comments:
Post a Comment