当前位置: 首页>>代码示例>>Java>>正文


Java FormComponent.getInput方法代码示例

本文整理汇总了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);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:20,代码来源:OneRequiredFormValidator.java

示例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);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:15,代码来源:InputChangeBehavior.java


注:本文中的org.apache.wicket.markup.html.form.FormComponent.getInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。