Java Code Examples for com.smartgwt.client.widgets.form.fields.TextItem#setWidth()
The following examples show how to use
com.smartgwt.client.widgets.form.fields.TextItem#setWidth() .
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: Setup.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
/** * Prepares the repository form */ private Tab setupRepository(final ValuesManager vm, GUIInfo info) { // Prepare the tab used to configure the repository where documents and // other data will be stored Tab repositoryTab = new Tab(); repositoryTab.setTitle(I18N.message("repository")); final DynamicForm repositoryForm = new DynamicForm(); repositoryForm.setID("repositoryForm"); repositoryForm.setValuesManager(vm); String dir = info.getConfig("store.1.dir"); if (dir != null && dir.endsWith("docs")) dir = dir.substring(0, dir.length() - 4); TextItem repositoryItem = ItemFactory.newTextItem(REPOSITORY_FOLDER, "repofolder", dir); repositoryItem.setWidth(400); repositoryItem.setRequired(true); repositoryItem.setWrapTitle(false); repositoryItem.setDefaultValue(getDefaultFolder()); repositoryForm.setFields(repositoryItem); repositoryForm.setDisabled(true); repositoryTab.setPane(repositoryForm); return repositoryTab; }
Example 2
Source File: EventNameForm.java From SensorWebClient with GNU General Public License v2.0 | 6 votes |
private TextItem createAbonnementNameItem() { aboNameItem = new TextItem(); aboNameItem.setRequired(true); aboNameItem.setTextBoxStyle("n52_sensorweb_client_abo_name_textbox"); aboNameItem.setTitle(i18n.aboName()); aboNameItem.setWidth("*"); // fill form column aboNameItem.setKeyPressFilter("[0-9a-zA-Z_]"); aboNameItem.setValue(controller.createSuggestedAbonnementName()); aboNameItem.addKeyUpHandler(new KeyUpHandler() { public void onKeyUp(KeyUpEvent event) { TextItem nameItem = (TextItem) event.getSource(); String currentAbonnementName = (String) nameItem.getValue(); controller.setSelectedAbonnementName(currentAbonnementName); } }); return aboNameItem; }
Example 3
Source File: DigitalObjectChildrenEditor.java From proarc with GNU General Public License v3.0 | 6 votes |
private DynamicForm createParamsForm() { ClientMessages i18n = GWT.create(ClientMessages.class); DynamicForm f = new DynamicForm(); f.setAutoHeight(); TextItem newPid = new TextItem(DigitalObjectDataSource.FIELD_PID); newPid.setTitle(i18n.NewDigObject_OptionPid_Title()); newPid.setTooltip(i18n.NewDigObject_OptionPid_Hint()); newPid.setRequired(true); newPid.setLength(36 + 5); newPid.setWidth((36 + 5) * 8); newPid.setValidators(new CustomUUIDValidator(i18n)); f.setFields(newPid); f.setAutoFocus(true); return f; }
Example 4
Source File: DeviceManager.java From proarc with GNU General Public License v3.0 | 6 votes |
private DynamicForm createForm() { DynamicForm df = new DynamicForm(); df.setMargin(4); df.setNumCols(1); df.setTitleOrientation(TitleOrientation.TOP); df.setBrowserSpellCheck(false); df.setDataSource(DeviceDataSource.getInstance()); TextItem fieldId = new TextItem(DeviceDataSource.FIELD_ID); fieldId.setWidth(280); fieldId.setCanEdit(false); fieldId.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC); TextItem fieldModel = new TextItem(DeviceDataSource.FIELD_MODEL); fieldModel.setCanEdit(false); fieldModel.setRequired(true); TextItem fieldLabel = new TextItem(DeviceDataSource.FIELD_LABEL); fieldLabel.setRequired(true); fieldLabel.setWidth("*"); df.setItems(fieldId, fieldModel, fieldLabel); return df; }
Example 5
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
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 6
Source File: UploadFile.java From proarc with GNU General Public License v3.0 | 6 votes |
private DynamicForm createForm() { DynamicForm form = new DynamicForm(); form.setEncoding(Encoding.MULTIPART); form.setBrowserSpellCheck(false); form.setNumCols(2); form.setTitleOrientation(TitleOrientation.TOP); form.setCanSubmit(true); TextItem mimeItem = new TextItem(FIELD_MIMETYPE, i18n.DigitalObjectEditor_MediaEditor_Uploader_Mimetype_Title()); mimeItem.setWidth(400); mimeItem.setColSpan(2); TextItem filenameItem = new TextItem(FIELD_FILE, i18n.DigitalObjectEditor_MediaEditor_Uploader_Filename_Title()); filenameItem.setWidth(400); filenameItem.setColSpan(2); filenameItem.setRequired(Boolean.TRUE); HiddenItem pidItem = new HiddenItem(FIELD_PID); HiddenItem batchIdItem = new HiddenItem(FIELD_BATCHID); form.setFields(filenameItem, mimeItem, pidItem, batchIdItem); return form; }
Example 7
Source File: DigitalObjectSearchView.java From proarc with GNU General Public License v3.0 | 5 votes |
private static TextItem createAdvancedItem(String name, String title, FormItemIfFunction showIf) { TextItem item = new TextItem(name, title); if (showIf != null) { item.setShowIfCondition(showIf); } item.setWidth("100%"); item.setColSpan(3); item.setValidators(new LengthRangeValidator() {{ setMax(1000); }}); return item; }
Example 8
Source File: IdentifierDataSource.java From proarc with GNU General Public License v3.0 | 5 votes |
public IdentifierDataSource() { setID(ID); ClientMessages i18n = GWT.create(ClientMessages.class); SmartGwtMessages i18nSmartGwt = ClientUtils.createSmartGwtMessages(); DataSourceField type = new DataSourceField(FIELD_TYPE, FieldType.TEXT, i18n.PageForm_IdentifierType_Title()); type.setRequired(Boolean.TRUE); ComboBoxItem typeEditor = new ComboBoxItem(IdentifierDataSource.FIELD_TYPE); LocalizationDataSource.setOptionDataSource(typeEditor, BundleName.MODS_IDENTIFIER_TYPES); typeEditor.setType("comboBox"); typeEditor.setCharacterCasing(CharacterCasing.LOWER); typeEditor.setBrowserSpellCheck(Boolean.FALSE); type.setEditorType(typeEditor); DataSourceField value = new DataSourceField(FIELD_VALUE, FieldType.TEXT, i18n.PageForm_IdentifierValue_Title()); value.setRequired(Boolean.TRUE); TextItem valueEditor = new TextItem(IdentifierDataSource.FIELD_VALUE); valueEditor.setWidth("250"); valueEditor.setBrowserSpellCheck(Boolean.FALSE); valueEditor.setRequired(Boolean.TRUE); valueEditor.setValidators(new IdentifierValidator(i18n, i18nSmartGwt)); value.setEditorType(valueEditor); DataSourceField object = new DataSourceField(FIELD_VALUE, FieldType.ANY); object.setHidden(true); setFields(type, value); setClientOnly(true); setCacheAllData(true); }
Example 9
Source File: TextContentCreate.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public TextContentCreate() { setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("createtextcontent")); setCanDragResize(true); setIsModal(true); setShowModalMask(true); setAutoSize(true); centerInPage(); DynamicForm form = new DynamicForm(); vm = new ValuesManager(); form.setValuesManager(vm); form.setTitleOrientation(TitleOrientation.TOP); form.setNumCols(1); TextItem filename = ItemFactory.newTextItem("filename", "filename", null); filename.setRequired(true); filename.setWidth(200); SelectItem template = ItemFactory.newTemplateSelector(true, null); create = new SubmitItem(); create.setTitle(I18N.message("create")); create.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onCreate(); } }); form.setItems(filename, template, create); addItem(form); }
Example 10
Source File: WebcontentCreate.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public WebcontentCreate() { setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("createwebcontent")); setCanDragResize(true); setIsModal(true); setShowModalMask(true); setAutoSize(true); centerInPage(); DynamicForm form = new DynamicForm(); vm = new ValuesManager(); form.setValuesManager(vm); form.setTitleOrientation(TitleOrientation.TOP); form.setNumCols(1); TextItem title = ItemFactory.newSimpleTextItem("title", "title", null); title.setRequired(true); title.setWidth(200); SelectItem template = ItemFactory.newTemplateSelector(true, null); create = new SubmitItem(); create.setTitle(I18N.message("create")); create.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onCreate(); } }); form.setItems(title, template, create); addItem(form); }
Example 11
Source File: WorkflowMaterialView.java From proarc with GNU General Public License v3.0 | 5 votes |
private DynamicForm createFolderForm() { DynamicForm form = createExpansionForm(); TextItem path = new TextItem(WorkflowMaterialDataSource.FIELD_FOLDER_PATH); path.setWidth("*"); form.setDataSource(WorkflowMaterialDataSource.getInstance(), path, createNoteItem(), createSaveItem()); return form; }
Example 12
Source File: FormCreate.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public FormCreate(FormsPanel grid) { this.grid = grid; setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("createform")); setCanDragResize(true); setIsModal(true); setShowModalMask(true); centerInPage(); setAutoSize(true); DynamicForm form = new DynamicForm(); vm = new ValuesManager(); form.setValuesManager(vm); form.setTitleOrientation(TitleOrientation.TOP); form.setNumCols(1); TextItem name = ItemFactory.newSimpleTextItem("name", "name", null); name.setRequired(true); name.setWidth(200); SelectItem template = ItemFactory.newTemplateSelector(true, null); create = new SubmitItem(); create.setTitle(I18N.message("create")); create.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onCreate(); } }); form.setItems(name, template, create); addItem(form); }
Example 13
Source File: WorkflowTaskFormView.java From proarc with GNU General Public License v3.0 | 5 votes |
private FormItem createFormItem(DisplayType displayType, Record profile) { String name = profile.getAttribute(WorkflowParameterDataSource.FIELD_NAME); switch (displayType) { case SELECT: SelectItem si = new SelectItem(); setOptions(si, profile); si.setWidth("*"); return si; case COMBOBOX: ComboBoxItem cbi = new ComboBoxItem(); setOptions(cbi, profile); cbi.setLength(2000); cbi.setWidth("*"); return cbi; case CHECKBOX: CheckboxItem ci = new CheckboxItem(); // the width must be set otherwise it overflows the form ci.setWidth(150); ci.setAllowEmptyValue(true); return ci; case TEXTAREA: TextAreaItem tai = new TextAreaItem(); tai.setStartRow(true); tai.setEndRow(true); tai.setLength(2000); tai.setColSpan("*"); tai.setWidth("*"); tai.setHeight(30); return tai; case DATETIME: DateTimeItem di = new DateTimeItem(); return di; case TEXT: default: TextItem ti = new TextItem(name); ti.setLength(2000); ti.setWidth("*"); return ti; } }
Example 14
Source File: LoginWindow.java From proarc with GNU General Public License v3.0 | 5 votes |
private DynamicForm createForm() { DynamicForm f = new DynamicForm(); f.setWidth(400); f.setBrowserSpellCheck(false); f.setNumCols(1); f.setTitleOrientation(TitleOrientation.TOP); f.setSaveOnEnter(true); TextItem user = new TextItem(USERNAME, i18nSgwt.dialog_UserNameTitle()); user.setRequired(true); user.setWidth("*"); user.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC); PasswordItem passwd = new PasswordItem(PASSWORD, i18nSgwt.dialog_PasswordTitle()); passwd.setRequired(true); passwd.setWidth("*"); TextItem producerCode = new TextItem(PRODUCER_CODE, i18n.LoginWindow_ProducerCode()); producerCode.setWidth("*"); producerCode.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC); StaticTextItem error = new StaticTextItem(ERROR); error.setShowTitle(false); error.setShowErrorText(true); f.setItems(user, producerCode, passwd, error); f.addSubmitValuesHandler(new SubmitValuesHandler() { @Override public void onSubmitValues(SubmitValuesEvent event) { submitCredentials(); } }); return f; }
Example 15
Source File: FormGenerator.java From proarc with GNU General Public License v3.0 | 5 votes |
public TextItem getDateYearFormItem(Field f, String lang) { TextItem item = getTextFormItem(f, lang); item.setWidth("150"); DateEditorValue yearEditorValue = DateEditorValue.gYear(); item.setEditorValueFormatter(yearEditorValue); item.setEditorValueParser(yearEditorValue); return item; }
Example 16
Source File: YubiKeySetup.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public YubiKeySetup(GUIUser user) { super(); setWidth100(); setHeight100(); setMembersMargin(5); setMargin(5); this.user = user; // Prepare the form with account informations TextItem keyItem = ItemFactory.newTextItem("key", I18N.message("key"), null); keyItem.setWidth(300); keyItem.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { if (event.getKeyName() != null && "enter".equals(event.getKeyName().toLowerCase())) { onSubmitKey(); } } }); form = new DynamicForm(); form.setTitleOrientation(TitleOrientation.LEFT); form.setNumCols(4); form.setItems(keyItem); hint = new Label(I18N.message(Constants.TWOFA_YUBIKEY + ".hint1")); setMembers(hint, form); }
Example 17
Source File: TagsSettingsPanel.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
@Override public void onDraw() { DynamicForm parametersForm = new DynamicForm(); parametersForm.setValuesManager(vm); parametersForm.setTitleOrientation(TitleOrientation.LEFT); parametersForm.setNumCols(2); parametersForm.setColWidths(1, "*"); parametersForm.setPadding(5); SelectItem mode = ItemFactory.newTagInputMode("mode", "inputmode"); SpinnerItem maxsize = ItemFactory.newSpinnerItem("maxsize", I18N.message("maxsize"), (Long) null); maxsize.setRequired(true); SpinnerItem minsize = ItemFactory.newSpinnerItem("minsize", I18N.message("minsize"), (Long) null); minsize.setRequired(true); SpinnerItem cloudElements = ItemFactory.newSpinnerItem("cloudElements", I18N.message("tagcloudelements"), (Long) null); cloudElements.setRequired(true); cloudElements.setWrapTitle(false); TextItem vocabulary = ItemFactory.newTextItem("vocabulary", I18N.message("vocabulary"), null); vocabulary.setRequired(true); vocabulary.setWidth(300); parametersForm.setItems(mode, maxsize, minsize, cloudElements, vocabulary); addMember(parametersForm); for (GUIParameter p : settings) { if (p.getName().endsWith("tag.mode")) mode.setValue(p.getValue()); if (p.getName().endsWith("tag.maxsize")) maxsize.setValue(p.getValue()); if (p.getName().endsWith("tag.minsize")) minsize.setValue(p.getValue()); if (p.getName().endsWith("tag.vocabulary")) vocabulary.setValue(p.getValue()); if (p.getName().endsWith("tagcloud.maxtags")) cloudElements.setValue(p.getValue()); } IButton save = new IButton(); save.setTitle(I18N.message("save")); save.addClickHandler(new ClickHandler() { @SuppressWarnings("unchecked") public void onClick(ClickEvent event) { final Map<String, Object> values = (Map<String, Object>) vm.getValues(); if (vm.validate()) { List<GUIParameter> params = new ArrayList<GUIParameter>(); params.add(new GUIParameter(Session.get().getTenantName() + ".tag.mode", values.get("mode") .toString())); params.add(new GUIParameter(Session.get().getTenantName() + ".tag.maxsize", values.get("maxsize") .toString())); params.add(new GUIParameter(Session.get().getTenantName() + ".tag.minsize", values.get("minsize") .toString())); params.add(new GUIParameter(Session.get().getTenantName() + ".tag.vocabulary", values.get( "vocabulary").toString())); params.add(new GUIParameter(Session.get().getTenantName() + ".tagcloud.maxtags", values.get( "cloudElements").toString())); SettingService.Instance.get().saveSettings(params.toArray(new GUIParameter[0]), new AsyncCallback<Void>() { @Override public void onFailure(Throwable caught) { Log.serverError(caught); } @Override public void onSuccess(Void ret) { Session.get() .getInfo() .setConfig(Session.get().getTenantName() + ".tag.mode", values.get("mode").toString()); Session.get() .getInfo() .setConfig(Session.get().getTenantName() + ".tag.maxsize", values.get("maxsize").toString()); Session.get() .getInfo() .setConfig(Session.get().getTenantName() + ".tag.minsize", values.get("minsize").toString()); Session.get() .getInfo() .setConfig(Session.get().getTenantName() + ".tagcloud.maxtags", values.get("cloudElements").toString()); Log.info(I18N.message("settingssaved"), null); } }); } } }); addMember(save); }
Example 18
Source File: GDriveCreate.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public GDriveCreate() { setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("createdoc")); setWidth(300); setHeight(120); setCanDragResize(true); setIsModal(true); setShowModalMask(true); centerInPage(); setPadding(5); setMembersMargin(3); DynamicForm form = new DynamicForm(); vm = new ValuesManager(); form.setValuesManager(vm); form.setTitleOrientation(TitleOrientation.TOP); TextItem fileName = ItemFactory.newTextItem("fileName", "filename", null); fileName.setRequired(true); fileName.setWidth(200); SelectItem type = ItemFactory.newSelectItem("type", I18N.message("type")); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("doc", "doc"); map.put("docx", "docx"); map.put("odt", "odt"); map.put("txt", "txt"); map.put("xls", "xls"); map.put("xlsx", "xlsx"); map.put("ods", "ods"); map.put("ppt", "ppt"); map.put("pptx", "pptx"); map.put("odp", "odp"); type.setValueMap(map); type.setValue("doc"); type.setWidth(50); type.setEndRow(true); type.setRequired(true); create = new SubmitItem(); create.setTitle(I18N.message("create")); create.setAlign(Alignment.RIGHT); create.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onCreate(); } }); form.setItems(fileName, type, create); addItem(form); }
Example 19
Source File: DigitalObjectAdministrationEditor.java From proarc with GNU General Public License v3.0 | 4 votes |
public PlainEditor(ClientMessages i18n) { widget = new VLayout(); form = new DynamicForm(); form.setDataSource(DigitalObjectAdministrationDataSource.getInstance()); form.setBrowserSpellCheck(false); TextItem pid = new TextItem(DigitalObjectAdministrationDataSource.FIELD_PID, i18n.DigitalObjectEditor_AdministrationEditor_Pid_Title()); pid.setWidth("*"); pid.setCanEdit(Boolean.FALSE); TextItem model = new TextItem(DigitalObjectAdministrationDataSource.FIELD_MODEL, i18n.DigitalObjectEditor_AdministrationEditor_Model_Title()); model.setCanEdit(Boolean.FALSE); TextItem owner = new TextItem(DigitalObjectAdministrationDataSource.FIELD_OWNER, i18n.DigitalObjectEditor_AdministrationEditor_Owner_Title()); owner.setCanEdit(Boolean.FALSE); TextItem creationDate = new TextItem(DigitalObjectAdministrationDataSource.FIELD_CREATED, i18n.DigitalObjectEditor_AdministrationEditor_Created_Title()); creationDate.setCanEdit(Boolean.FALSE); TextItem modificationDate = new TextItem(DigitalObjectAdministrationDataSource.FIELD_MODIFIED, i18n.DigitalObjectEditor_AdministrationEditor_Modified_Title()); modificationDate.setCanEdit(Boolean.FALSE); SelectItem device = new SelectItem(DigitalObjectAdministrationDataSource.FIELD_DEVICE, i18n.DigitalObjectEditor_AdministrationEditor_Device_Title()); device.setWidth(250); DeviceDataSource.setOptionDataSource(device); device.setAllowEmptyValue(true); device.setEmptyDisplayValue(ClientUtils.format("<i><%s></i>", i18n.DigitalObjectEditor_AdministrationEditor_NoDeviceSelection_Title())); TextItem filename = new TextItem(DigitalObjectAdministrationDataSource.FIELD_FILENAME, i18n.DigitalObjectEditor_AdministrationEditor_File_Title()); filename.setWidth("*"); filename.setCanEdit(Boolean.FALSE); TextItem export = new TextItem(DigitalObjectAdministrationDataSource.FIELD_EXPORT, i18n.DigitalObjectEditor_AdministrationEditor_Export_Title()); export.setWidth("*"); export.setCanEdit(Boolean.FALSE); TextItem ndkExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_NDK_EXPORT, i18n.DigitalObjectEditor_AdministrationEditor_Ndk_Export_Title()); ndkExport.setWidth("*"); ndkExport.setCanEdit(Boolean.FALSE); TextItem archiveExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_ARCHIVE_EXPORT, i18n.DigitalObjectEditor_AdministrationEditor_Archive_Export_Title()); archiveExport.setWidth("*"); archiveExport.setCanEdit(Boolean.FALSE); TextItem krameriusExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_KRAMERIUS_EXPORT, i18n.DigitalObjectEditor_AdministrationEditor_Kramerius_Export_Title()); krameriusExport.setWidth("*"); krameriusExport.setCanEdit(Boolean.FALSE); TextItem crossrefExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_CROSSREF_EXPORT, i18n.DigitalObjectEditor_AdministrationEditor_Crossref_Export_Title()); crossrefExport.setWidth("*"); crossrefExport.setCanEdit(Boolean.FALSE); ComboBoxItem organization = new ComboBoxItem(DigitalObjectAdministrationDataSource.FIELD_ORGANIZATION, i18n.UsersView_ListHeader_Organization_Title()); organization.setWidth(250); organization.setValueMap(Organization.getMap()); ComboBoxItem user = new ComboBoxItem(DigitalObjectAdministrationDataSource.FIELD_USER, i18n.UsersView_ListHeader_Proccesor_Title()); user.setWidth(250); user.setOptionDataSource(UserDataSource.getInstance()); user.setValueField(UserDataSource.FIELD_USERNAME); user.setDisplayField(UserDataSource.FIELD_USERNAME); ComboBoxItem status = new ComboBoxItem(DigitalObjectAdministrationDataSource.FIELD_STATUS, i18n.DigitalObjectEditor_AdministrationEditor_Status_Title()); status.setWidth(250); status.setValueMap(DigitalObjectState.getMap(i18n)); form.setItems(pid, model, owner, creationDate, modificationDate, device, filename, export, ndkExport, krameriusExport, archiveExport, crossrefExport, organization, user, status); widget.setMembers(form); }
Example 20
Source File: Registration.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public Registration(String[] reg) { super(); setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("registration")); setWidth(350); setHeight(150); setIsModal(true); setShowModalMask(true); centerInPage(); setAutoSize(true); final DynamicForm form = new DynamicForm(); form.setValuesManager(vm); form.setMargin(5); form.setNumCols(2); form.setTitleOrientation(TitleOrientation.TOP); TextItem regName = ItemFactory.newTextItem("reg_name", "name", null); regName.setWrapTitle(false); regName.setValue(reg[0]); TextItem regEmail = ItemFactory.newEmailItem("reg_email", "email", false); regEmail.setWrapTitle(false); regEmail.setValue(reg[1]); TextItem regOrganization = ItemFactory.newTextItem("reg_organization", "organization", null); regOrganization.setWrapTitle(false); regOrganization.setValue(reg[2]); TextItem regWebsite = ItemFactory.newTextItem("reg_website", "website", null); regWebsite.setWidth(180); regWebsite.setWrapTitle(false); regWebsite.setValue(reg[3]); ButtonItem apply = new ButtonItem(); apply.setTitle(I18N.message("apply")); apply.setAutoFit(true); apply.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { vm.validate(); if (!vm.hasErrors()) { SettingService.Instance.get().saveRegistration(form.getValueAsString("reg_name"), form.getValueAsString("reg_email"), form.getValueAsString("reg_organization"), form.getValueAsString("reg_website"), new AsyncCallback<Void>() { @Override public void onFailure(Throwable caught) { SC.warn(caught.getMessage()); } @Override public void onSuccess(Void ret) { afterSave(); Registration.this.destroy(); } }); } } }); form.setFields(regName, regEmail, regOrganization, regWebsite, apply); addItem(form); }