Hi, On selection of a dropdown i,m calling onChange method in that setting Global variables with some data. The Global variables are binded to the InputText boxes in the form. But my problem is those setted values are not displaying in the form after Onchange dropdown but it is setting in bean variables(tested with System.out.print)
JSP : <ig:dropDownList binding="#{Page1.htmlDropDownList1}" dataSource="#{Page1.list}" id="htmlDropDownList1" smartRefreshIds="textField1"
You should not use the setFld method to control the value of fld. In JSF the setters are used by the JSF framework to update values arriving from the browser.
Instead, use the getFld method. When JSF wants to get the value of fld, this is the method it'll use.
So, you might pattern your code like this:
public class Bean {
private boolean male;
public void onChange(ActionEvent e) {
if(e.newValue().equals("male")) male=true;
else male = false;
}
public String getFld() {
if(male) return "Hello Sir";
else return "Hello Miss";
HiThanks for your early reply.The solution you provided that doesn't suit to my problem.My problem is : I have to show Dropdown selected value on the Text box.For Example : In my dropdown i have "A" , "B" , "C"----> if i select A then A should display on the Text box--> on selecting B that should display on text box. pls provide me the better solution with one exampleWaiting for your early replyRgdsAslam