...and the backi" /> ...and the backi" /> ...and the backi"/>

h:selectBooleanCheckbox cannot set value

187 Views Asked by At

I am trying to bind h:selectBooleanCheckbox to its backing bean twin as :

<h:selectBooleanCheckbox id="jojo" binding="myBean.sbc0" />

...and the backing bean :

@ManagedBean(name="myBean")
@RequestScoped
public class MyBean{
...
private HtmlSelectBooleanCheckbox sbc0;
...
@PostConstruct
public void initui(){
  sbc0=new HtmlSelectBooleanCheckbox();
}

public void doValue(){//h:commandButton ajax event handle method
 this.sbc0.setValue(""+Math.random()); //<---doesn't set value?
}

}

...and using js to get value fails returning 'on' only

var v=document.getElementById("jojo").value;//<---returns 'on' only :(

As I can get it, the value may have any string etc (correct me if I am wrong)... So my question is what may cause the problem and how to fix it?

0

There are 0 best solutions below