本文整理汇总了Java中javax.faces.component.EditableValueHolder.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java EditableValueHolder.setValue方法的具体用法?Java EditableValueHolder.setValue怎么用?Java EditableValueHolder.setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.component.EditableValueHolder
的用法示例。
在下文中一共展示了EditableValueHolder.setValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _resetEditableValueHolder
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
private void _resetEditableValueHolder(EditableValueHolder evh)
{
evh.setValue(null);
evh.setSubmittedValue(null);
evh.setLocalValueSet(false);
evh.setValid(true);
}
示例2: doTestUpdateModelValues
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
/**
* Tests the update-model-values lifecycle phase.
*/
protected void doTestUpdateModelValues(
UIViewRoot root,
UIComponent component)
{
Mock mockRenderkit = getMockRenderKitWrapper().getMock();
Mock mockRenderer = mock(Renderer.class);
Renderer renderer = (Renderer) mockRenderer.proxy();
mockRenderkit.stubs().method("getRenderer").will(returnValue(renderer));
Mock mockBinding = mock(ValueBinding.class);
ValueBinding binding = (ValueBinding) mockBinding.proxy();
setCurrentContext(facesContext);
// if the component is an EditableValueHolder, then the value binding
// must be updated with the new value before this phase completes.
if (component instanceof EditableValueHolder)
{
EditableValueHolder editable = (EditableValueHolder)component;
component.setValueBinding("value", binding);
editable.setValue("newValue");
mockBinding.expects(atLeastOnce()).method("setValue").with(eq(facesContext), eq("newValue"));
assertEquals(true, editable.isLocalValueSet());
}
doTestUpdateModelValues(facesContext, root, component);
setCurrentContext(null);
mockRenderer.verify();
mockBinding.verify();
}
示例3: _setEVHData
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
private void _setEVHData(
EditableValueHolder testComp,
String value,
boolean isValid)
{
testComp.setSubmittedValue("submitedValue-"+value);
testComp.setValue("Value-"+value);
testComp.setValid(isValid);
}
示例4: adjustState
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
/**
* Save the new paging state back to the given component (adjusting firstItem and lastItem first if necessary)
*/
private static void adjustState(FacesContext context, UIComponent component, int firstItem, int lastItem, int pageSize, int totalItems, int newFirstItem, int newLastItem, int newPageSize)
{
// recalculate last item
newLastItem = Math.min(newFirstItem + newPageSize, totalItems);
if (newPageSize <= 0)
{
// if displaying all items
newFirstItem = 0;
newLastItem = totalItems;
}
// we don't count lastItem changing as a full state change (value of this component doesn't change)
if (newLastItem != lastItem) RendererUtil.setAttribute(context, component, "lastItem", new Integer(newLastItem));
// send the newly changed values where they need to go
if (newPageSize != pageSize) RendererUtil.setAttribute(context, component, "pageSize", new Integer(newPageSize));
if (newFirstItem != firstItem) RendererUtil.setAttribute(context, component, "firstItem", new Integer(newFirstItem));
// Set value, which causes registered valueChangeListener to be called
EditableValueHolder evh = (EditableValueHolder) component;
String newValue = formatValue(newFirstItem, newPageSize);
Object oldValue = (String)evh.getValue();
if (!newValue.equals(oldValue))
{
if (oldValue != null) {
evh.setSubmittedValue(newValue);
evh.setValid(true);
} else {
// Need to initialize value string based on initial parameters.
if (log.isDebugEnabled()) log.debug("initializing value to " + newValue);
evh.setValue(newValue);
}
}
}
示例5: apply
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
public void apply(EditableValueHolder evh) {
evh.setValue(this.value);
evh.setValid(this.valid);
evh.setSubmittedValue(this.submittedValue);
evh.setLocalValueSet(this.localValueSet);
}
示例6: apply
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
public void apply(EditableValueHolder evh) {
evh.setValue(this.value);
evh.setValid(this.valid);
evh.setSubmittedValue(this.submittedValue);
evh.setLocalValueSet(this.localValueSet);
}