Hi Isomorphic,
I'm having some design issues with BatchUploader using v10.1p_2016-03-27:

The strange think is that in the Developer Console, "Evaluate JS Expression" I get this:
Also calling markForRedraw() does not change it.
This is the testcase (Simplicity based):
Best regards
Blama
I'm having some design issues with BatchUploader using v10.1p_2016-03-27:
- "ESC"-key does not bubble to the Window to close it when in BatchUploader or when in the area next to the buttons on the bottom
- I can't get the FileItem to end at the right border of the "Change my text" button, as I can't access the FormItem to do setColSpan(3). Could you make it an AutoChild?
- uploadForm.setWidth100() does not set to 100% width
- Changing the button title for "Change my text" button does not work with the button on the bottom.
The strange think is that in the Developer Console, "Evaluate JS Expression" I get this:
Code:
[B]COMMAND:[/B]
isc_BatchUploader_0.uploadForm.fields[1]
[B]RESULT:[/B]
Evaluator: result of 'isc_BatchUploader_0.uploadForm.fields[1]' (0ms):
{__ref: {GWT Java Obj},
__module: {GWT Module Obj},
AUTOIDClass: "ButtonItem",
name: "DUMMY",
_autoAssignedName: false,
editorType: "ButtonItem",
createCanvas: [a]ButtonItem.createCanvas(),
title: "[B]Changed via object[/B]",
startRow: false,
type: undef,
}
This is the testcase (Simplicity based):
Code:
package com.smartgwt.sample.client;
import java.util.LinkedHashMap;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.Version;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.BatchUploader;
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.ButtonItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.layout.VLayout;
public class BuiltInDS implements EntryPoint {
private VLayout mainLayout;
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();
}
});
mainLayout = new VLayout(20);
mainLayout.setWidth100();
mainLayout.setHeight100();
recreateBtn = new IButton("Recreate");
recreateBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
recreate();
}
});
mainLayout.addMember(recreateBtn);
recreate();
mainLayout.draw();
}
private void recreate() {
Window w = new Window();
w.setWidth("50%");
w.setHeight("50%");
w.setBackgroundColor("#EEE");
w.setMembersMargin(0);
w.setModalMaskOpacity(70);
w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
w.setTitle("BatchUploader Design Problems" + w.getTitle());
w.setShowMinimizeButton(false);
w.setDismissOnEscape(true);
w.setIsModal(true);
w.setShowModalMask(true);
w.centerInPage();
DynamicForm uploadForm = new DynamicForm();
uploadForm.setWidth100();
uploadForm.setNumCols(3);
uploadForm.setTitleWidth(120);
BatchUploader.changeAutoChildDefaults("uploadForm", uploadForm);
final BatchUploader bu = new BatchUploader();
bu.setWidth100();
bu.setBackgroundColor("#EEE");
bu.setUploadDataSource(DataSource.get("employees"));
final SelectItem onetwo = new SelectItem("SI", "Change button name");
onetwo.setWidth("*");
onetwo.setValueMap(new LinkedHashMap<String, String>() {
private static final long serialVersionUID = 1L;
{
put("Key-one", "Value-one");
put("Key-two", "Value-two");
}
});
final ButtonItem dummy = new ButtonItem("DUMMY", "Change my text");
dummy.setStartRow(false);
bu.setUploadFormFields(onetwo, dummy);
w.addItem(bu);
IButton change1 = new IButton("Change via object");
change1.setWidth(200);
change1.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
dummy.setTitle("Changed via object");
;
}
});
w.addItem(change1);
IButton change2 = new IButton("Change via DynamicForm");
change2.setWidth(200);
change2.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
bu.getUploadForm().getField("DUMMY").setTitle("Changed via DynamicForm");
}
});
w.addItem(change2);
w.show();
}
}
Blama
Comment