本文整理汇总了Java中javax.faces.event.ValueChangeListener类的典型用法代码示例。如果您正苦于以下问题:Java ValueChangeListener类的具体用法?Java ValueChangeListener怎么用?Java ValueChangeListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValueChangeListener类属于javax.faces.event包,在下文中一共展示了ValueChangeListener类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addValueChangeListener
import javax.faces.event.ValueChangeListener; //导入依赖的package包/类
public void addValueChangeListener(final ValueChangeListener listener) {
getBind().addValueChangeListener(listener);
getBind().setImmediate(true);
ajax = new AjaxBehavior();
ajax.setTransient(true);
ajax.setRender(getValueChangeRender());
getBind().addClientBehavior("valueChange", ajax);
}
示例2: addValueChangeListener
import javax.faces.event.ValueChangeListener; //导入依赖的package包/类
@Override
public void addValueChangeListener(ValueChangeListener listener) {
throw new UnsupportedOperationException();
}
示例3: getValueChangeListeners
import javax.faces.event.ValueChangeListener; //导入依赖的package包/类
@Override
public ValueChangeListener[] getValueChangeListeners() {
throw new UnsupportedOperationException();
}
示例4: removeValueChangeListener
import javax.faces.event.ValueChangeListener; //导入依赖的package包/类
@Override
public void removeValueChangeListener(ValueChangeListener listener) {
throw new UnsupportedOperationException();
}
示例5: doTestProcessValidations
import javax.faces.event.ValueChangeListener; //导入依赖的package包/类
/**
* Tests the process-validations lifecycle phase.
*/
protected void doTestProcessValidations(
UIViewRoot root,
UIComponent component,
Object submittedValue,
Object convertedValue)
{
Mock mockRenderKit = getMockRenderKitWrapper().getMock();
Mock mockRenderer = mock(Renderer.class);
Renderer renderer = (Renderer) mockRenderer.proxy();
mockRenderKit.stubs().method("getRenderer").will(returnValue(renderer));
Mock mockConverter = mock(Converter.class);
Converter converter = (Converter) mockConverter.proxy();
Mock mockValidator = mock(Validator.class);
Validator validator = (Validator) mockValidator.proxy();
Mock mockListener = mock(ValueChangeListener.class);
ValueChangeListener listener = (ValueChangeListener) mockListener.proxy();
setCurrentContext(facesContext);
// if the component is an EditableValueHolder, then the submitted value
// must be converted and validated before this phase completes.
if (component instanceof EditableValueHolder)
{
EditableValueHolder editable = (EditableValueHolder)component;
mockConverter.expects(never()).method("getAsObject");
mockConverter.expects(never()).method("getAsString");
mockRenderer.expects(once()).method("getConvertedValue").will(returnValue(convertedValue));
editable.setConverter(converter);
editable.setSubmittedValue(submittedValue);
editable.addValidator(validator);
editable.addValueChangeListener(listener);
mockListener.expects(once()).method("processValueChange");
mockValidator.expects(once()).method("validate").with(new Constraint[] { eq(facesContext), eq(component), eq(convertedValue) });
}
// if the component is a ValueHolder, then the value is not updated or
// validated and no value change event occurs.
else if (component instanceof ValueHolder)
{
ValueHolder holder = (ValueHolder)component;
holder.setConverter(converter);
mockConverter.expects(never()).method("getAsObject");//setExpectedGetAsObjectCalls(0);
mockConverter.expects(never()).method("getAsString");
}
doTestProcessValidations(facesContext, root, component);
mockRenderKit.verify();
mockRenderer.verify();
mockConverter.verify();
mockValidator.verify();
mockListener.verify();
setCurrentContext(null);
}
示例6: valueChangeListener
import javax.faces.event.ValueChangeListener; //导入依赖的package包/类
public default T valueChangeListener(ValueChangeListener listener) {
addValueChangeListener(listener); return (T) this;
}