本文整理汇总了Java中org.apache.wicket.markup.html.form.FormComponent.getInput方法的典型用法代码示例。如果您正苦于以下问题:Java FormComponent.getInput方法的具体用法?Java FormComponent.getInput怎么用?Java FormComponent.getInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.form.FormComponent
的用法示例。
在下文中一共展示了FormComponent.getInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: onUpdate
import org.apache.wicket.markup.html.form.FormComponent; //导入方法依赖的package包/类
@Override
protected void onUpdate(AjaxRequestTarget target) {
FormComponent<?> component = (FormComponent<?>) getComponent();
// IE triggers "input" event when the focused on the search input even if nothing is
// input into search box yet. To work around this issue, we compare search string
// against previous value to only update the branches table if there is an actual
// change.
String newInput = component.getInput();
if (!Objects.equals(newInput, input)) {
input = newInput;
onInputChange(target);
}
}