本文整理汇总了Java中com.smartgwt.client.widgets.form.fields.FormItem.setRequired方法的典型用法代码示例。如果您正苦于以下问题:Java FormItem.setRequired方法的具体用法?Java FormItem.setRequired怎么用?Java FormItem.setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.smartgwt.client.widgets.form.fields.FormItem
的用法示例。
在下文中一共展示了FormItem.setRequired方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customizeFormItem
import com.smartgwt.client.widgets.form.fields.FormItem; //导入方法依赖的package包/类
/**
* Adds common properties to simple {@link #getFormItem items}.
*/
public FormItem customizeFormItem(FormItem item, Field f) {
if (item.getTitle() == null) {
item.setShowTitle(false);
}
item.setRequired(f.getRequired());
item.setPrompt(f.getHint(activeLocale));
item.setHoverWidth(defaultHoverWidth);
if (f.getHidden() != null && f.getHidden()) {
item.setVisible(false);
}
String width = f.getWidth();
if (width != null) {
item.setWidth(width);
}
if (f.getHeight() != null) {
item.setHeight(f.getHeight());
}
if (f.getReadOnly() != null && f.getReadOnly()) {
item.setCanEdit(!f.getReadOnly());
}
return item;
}
示例2: resetIdentifierField
import com.smartgwt.client.widgets.form.fields.FormItem; //导入方法依赖的package包/类
/** Resets nested Identifier members. */
private void resetIdentifierField(FormItem fi, boolean clear, boolean visible, boolean required) {
Canvas canvas = ((RepeatableFormItem) fi).getCanvas();
RepeatableForm rf = (RepeatableForm) canvas;
for (Row row : rf.getRows()) {
ValuesManager vm = row.getForm();
DynamicForm[] nestedForms = vm.getMembers();
for (DynamicForm nf : nestedForms) {
for (FormItem formItem : nf.getFields()) {
formItem.setRequired(required);
}
}
}
resetField(fi, clear, visible, required);
}
示例3: updateProfile
import com.smartgwt.client.widgets.form.fields.FormItem; //导入方法依赖的package包/类
private void updateProfile(DynamicForm form, FormItem item, Field profile) {
if (profile != null) {
Boolean hidden = profile.getHidden();
form.setVisible(hidden == null || !hidden);
String title = profile.getTitle(null);
if (title != null) {
if (title.isEmpty()) {
item.setShowTitle(false);
}
item.setTitle(title);
}
String hint = profile.getHint(null);
if (hint != null) {
item.setPrompt(hint);
}
item.setRequired(profile.getRequired());
String width = profile.getWidth();
if (width != null) {
item.setWidth(width);
}
Integer length = profile.getLength();
if (length != null && item instanceof TextItem) {
((TextItem) item).setLength(length);
}
LinkedHashMap<String, String> valueMap = profile.getValueMap();
if (valueMap != null) {
// System.out.println("DCE.updateProfile.valueMap: " + valueMap);
item.setValueMap(valueMap);
}
}
}
示例4: resetField
import com.smartgwt.client.widgets.form.fields.FormItem; //导入方法依赖的package包/类
private void resetField(FormItem fi, boolean clear, boolean visible, boolean required) {
fi.setVisible(visible);
fi.setRequired(required);
clearIfTrue(clear, fi);
}
示例5: declareAsRequired
import com.smartgwt.client.widgets.form.fields.FormItem; //导入方法依赖的package包/类
protected void declareAsRequired(FormItem formItem) {
formItem.setErrorFormatter(createErrorFormatter("invalid", i18n.invalidInputs()));
formItem.setRequired(true);
}