本文整理汇总了Java中org.apache.wicket.markup.html.form.FormComponent.isEnabledInHierarchy方法的典型用法代码示例。如果您正苦于以下问题:Java FormComponent.isEnabledInHierarchy方法的具体用法?Java FormComponent.isEnabledInHierarchy怎么用?Java FormComponent.isEnabledInHierarchy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.form.FormComponent
的用法示例。
在下文中一共展示了FormComponent.isEnabledInHierarchy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkRequired
import org.apache.wicket.markup.html.form.FormComponent; //导入方法依赖的package包/类
/**
* Code copied from FormComponent#checkRequired, which is unfortunately useless as long as FormComponent#required is false.
*/
protected boolean checkRequired(FormComponent<?> formComponent) {
final String input = formComponent.getInput();
// when null, check whether this is natural for that component, or
// whether - as is the case with text fields - this can only happen
// when the component was disabled
if (input == null && !formComponent.isInputNullable() && !formComponent.isEnabledInHierarchy())
{
// this value must have come from a disabled field
// do not perform validation
return true;
}
// peform validation by looking whether the value is null or empty
return !Strings.isEmpty(input);
}