Java Code Examples for com.smartgwt.client.widgets.form.fields.TextItem#setName()

The following examples show how to use com.smartgwt.client.widgets.form.fields.TextItem#setName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static TextItem newEmailItem(String name, String title, boolean multiple) {
	TextItem item = new TextItem();
	item.setName(filterItemName(name));
	if (title != null)
		item.setTitle(I18N.message(title));
	else
		item.setShowTitle(false);
	if (multiple)
		item.setValidators(new EmailsValidator());
	else
		item.setValidators(new EmailValidator());
	item.setWrapTitle(false);
	item.setWidth(200);

	return item;
}
 
Example 2
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new TextItem.
 * 
 * @param name The item name (mandatory)
 * @param title The item title (mandatory)
 * @param value The item value (optional)
 * 
 * @return the text item
 */
public static TextItem newTextItem(String name, String title, String value) {
	TextItem item = new TextItem();
	item.setName(filterItemName(name));
	item.setTitle(I18N.message(title));
	if (value != null)
		item.setValue(value);
	else
		item.setValue("");
	item.setWrapTitle(false);
	item.setRequiredMessage(I18N.message("fieldrequired"));
	return item;
}