Hi Isomorphic,
please take a look at this test case.
This was working fine using v12.0p_2019-03-23/PowerEdition Deployment (built 2019-03-23) and it's not working using current built.
Best regards
Pavo
please take a look at this test case.
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.DateItem; import com.smartgwt.client.widgets.form.fields.FormItemIcon; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler; import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent; import com.smartgwt.client.widgets.form.fields.events.PickerIconClickEvent; import com.smartgwt.client.widgets.form.fields.events.PickerIconClickHandler; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS extends VLayout implements EntryPoint { private IButton recreateBtn; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); setWidth100(); setHeight100(); recreateBtn = new IButton("Recreate"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { new MyWindow().show(); } }); addMember(recreateBtn); new MyWindow().show(); draw(); } private class MyWindow extends Window { public MyWindow() { setWidth(600); setHeight(300); setMembersMargin(0); setModalMaskOpacity(70); setShowMinimizeButton(false); setIsModal(true); setShowModalMask(true); centerInPage(); DateItem dateItemBirthday = new DateItemBirthday("Test"); dateItemBirthday.setUseTextField(true); DynamicForm df = new DynamicForm(); df.setFields(dateItemBirthday); addItem(df); } } private class DateItemBirthday extends DateItem { public DateItemBirthday(String name) { super(name); setWidth(225); // when text field then not editable setTextFieldProperties(new TextItem() { { setCanEdit(false); } }); // Delete date icon FormItemIcon icon = new FormItemIcon(); icon.setSrc("http://127.0.0.1:8888/builtinds/sc/skins/Enterprise/images/DynamicForm/search_icon.svg"); icon.addFormItemClickHandler(new FormItemClickHandler() { @Override public void onFormItemClick(FormItemIconClickEvent event) { if (!getUseTextField()) setUseTextField(true); setValue((Object) null); } }); setIcons(icon); // Add button to edit birthday addPickerIconClickHandler(new PickerIconClickHandler() { @Override public void onPickerIconClick(PickerIconClickEvent event) { if (getUseTextField()) { setUseTextField(false); setValue(getValue()); } } }); } } }
Best regards
Pavo
Comment