本文整理汇总了Java中javax.faces.component.EditableValueHolder.setSubmittedValue方法的典型用法代码示例。如果您正苦于以下问题:Java EditableValueHolder.setSubmittedValue方法的具体用法?Java EditableValueHolder.setSubmittedValue怎么用?Java EditableValueHolder.setSubmittedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.component.EditableValueHolder
的用法示例。
在下文中一共展示了EditableValueHolder.setSubmittedValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void decode(FacesContext context, UIComponent component)
{
_addChildren(context, component);
Map<String, Object> attrs = component.getAttributes();
if (Boolean.TRUE.equals(attrs.get("readOnly")) ||
Boolean.TRUE.equals(attrs.get("disabled")))
return;
// Just clue in component that we have been "submitted" so
// that it doesn't short-circuit anything
EditableValueHolder evh = (EditableValueHolder) component;
evh.setSubmittedValue(Boolean.TRUE);
// Because these components weren't around during processDecodes(),
// they didn't get decoded. So, run that now.
component.getFacet("month").processDecodes(context);
component.getFacet("year").processDecodes(context);
component.getFacet("day").processDecodes(context);
}
示例2: decode
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
@Override
protected void decode(
FacesContext facesContext,
UIComponent component,
@SuppressWarnings("unused")
FacesBean facesBean,
String clientId)
{
if (skipDecode(facesContext))
return;
Object submittedValue;
if (!wasSubmitted(facesContext, component))
submittedValue = null;
else
{
if (clientId == null)
{
clientId = component.getClientId(facesContext);
}
submittedValue = getSubmittedValue(facesContext, component, clientId);
}
if (_LOG.isFinest())
{
if (clientId == null)
{
clientId = component.getClientId(facesContext);
}
_LOG.finest("Value submitted for ID {0} is {1}",
new Object[]{clientId, submittedValue});
}
EditableValueHolder evh = (EditableValueHolder) component;
evh.setSubmittedValue(submittedValue);
}
示例3: _resetEditableValueHolder
import javax.faces.component.EditableValueHolder; //导入方法依赖的package包/类
private void _resetEditableValueHolder(EditableValueHolder evh)
{
evh.setValue(null);
evh.setSubmittedValue(null);
evh.setLocalValueSet(false);
evh.setValid(true);
}
示例4: _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);
}
示例5: 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);
}
}
}
示例6: doTestProcessValidations
import javax.faces.component.EditableValueHolder; //导入方法依赖的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);
}
示例7: 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);
}
示例8: 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);
}