Hi,
I want to implement a validator. All works fine, the only problem I have is
the fact that I need the value of another component (radio button). How can
I obtain the other value?
the code is this:
public void validateInputValue(FacesContext context,
UIComponent toValidate,
Object value) {
BigDecimal inputValue = (BigDecimal) value;
if (inputValue .compareTo(BigDecimal("1000")) > 0) {
((UIInput)toValidate).setValid(false);
FacesMessage message = new FacesMessage("error");
context.addMessage(toValidate.getClientId(context),
message);
}
}
validator="#{enterprise.validateInputValue}"
The other component is:
<h:selectOneRadio id="radioValue"
value="#{enterpirse.radioValue}">
<f:selectItem itemValue="true" itemLabel="kWh" />
<f:selectItem itemValue="false" itemLabel="MWh" />
</h:selectOneRadio>
In the method "validateInputValue" from the backing bean I want to know also
the boolean value radioValue.
--
View this message in context:
http://www.nabble.com/obtain-the-component-value-tp23759909p23759909.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.