Hi,
SC_SNAPSHOT-2011-03-24/EVAL Deployment
FireFox 3.6.16
In my custom editor, which extends ComboBoxItem, I'm calling the getEnteredValue() and I'm getting the below error.
I have added a standalone test case. Type in "test%" as soon as you hit '%' the error is shown.
The below error is generated in our app, not the stand alone test case.
But you should get the same.
SC_SNAPSHOT-2011-03-24/EVAL Deployment
FireFox 3.6.16
In my custom editor, which extends ComboBoxItem, I'm calling the getEnteredValue() and I'm getting the below error.
I have added a standalone test case. Type in "test%" as soon as you hit '%' the error is shown.
Originally posted by javadoc
Code:
public class Standalone implements EntryPoint {
private static Canvas masterPanel = null;
boolean pickerShowing = false;
public void onModuleLoad() {
devConsole = new Button("DEV Console");
devConsole.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
public void onClick(ClickEvent event) {
SC.showConsole();
}
});
//masterPanel should be a Layout
masterPanel = new Canvas();
masterPanel.setHeight100();
masterPanel.setWidth100();
masterPanel.setStyleName("pageBackground"); //background style from skin
masterPanel.addChild(testCase14());
masterPanel.draw();
}
public DynamicForm testCase14() {
DataSource dataSource = new DataSource();
DataSourceField myTestField = new DataSourceField();
myTestField.setName("textField");
myTestField.setTitle("textField");
myTestField.setType(new MyComboBoxItem());
myTestField.setEditorType(new MySimpleComboBoxEditor());
dataSource.setFields(myTestField);
DynamicForm form = new DynamicForm();
form.setHeight(170);
form.setWidth(500);
form.setDataSource(dataSource);
return form;
}
}
public class MyComboBoxItem extends SimpleType {
public MyComboBoxItem() {
super("myComboBoxType", FieldType.ANY);
}
}
public class MySimpleComboBoxEditor extends ComboBoxItem {
public MySimpleComboBoxEditor() {
super();
setChangeOnKeypress(false);
setCompleteOnTab(true);
setSelectOnFocus(true);
setAddUnknownValues(false);
addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
if(event.getCharacterValue() != null && event.getCharacterValue().equals((int) '%')){
//to avoid null pointers in grid
MySimpleComboBoxEditor editor = (MySimpleComboBoxEditor) event.getSource();
String enteredValue = editor.getEnteredValue();
// String enteredValue = MySimpleComboBoxEditor.this.getEnteredValue();
SC.logWarn("entered value is: " + enteredValue);
}
}
});
}
But you should get the same.
Code:
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): self.getEnteredValue is not a function
fileName: http://127.0.0.1:8888
lineNumber: 107
stack: ()@http://127.0.0.1:8888:107
@:0
([object GWTJavaObject],5111972,[object GWTJavaObject])@http://127.0.0.1:8888/silkroad/hosted.html?silkroad:56
([object Object],[object Object],"`",37)@http://127.0.0.1:8888:93
((function () {var param = {item: arguments[0], form: arguments[1], keyName: arguments[2], characterValue: arguments[3]};var event = __gwt_makeJavaInvoke(1)(null, 5505119, param);__gwt_makeJavaInvoke(1)(selfJ, 5111972, event);var ret = __gwt_makeJavaInvoke(0)(event, 1507334);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8888:65
@:0
(null,106,(function () {var param = {item: arguments[0], form: arguments[1], keyName: arguments[2], characterValue: arguments[3]};var event = __gwt_makeJavaInvoke(1)(null, 5505119, param);__gwt_makeJavaInvoke(1)(selfJ, 5111972, event);var ret = __gwt_makeJavaInvoke(0)(event, 1507334);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8888/silkroad/hosted.html?silkroad:56
([object Object],[object Object],"`",37)@http://127.0.0.1:8888:16
([object Object],[object Object],"`",37)@http://127.0.0.1:8888:13
isc_FormItem__fireKeyPressHandlers([object Object],[object Object],"`",37)@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Forms.js:1549
isc_FormItem_handleKeyPress([object Object],[object Object])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Forms.js:1548
isc_c_Class_invokeSuper(null,"handleKeyPress")@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:305
isc_c_Class_Super("handleKeyPress",[object Object])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:297
isc_TextItem_handleKeyPress([object Object],[object Object])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Forms.js:1856
isc_c_Class_invokeSuper(null,"handleKeyPress")@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:305
isc_c_Class_Super("handleKeyPress",[object Object])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:297
isc_ComboBoxItem_handleKeyPress([object Object],[object Object])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Forms.js:2528
isc_c_EventHandler_bubbleEvent([object Object],"keyPress",[object Object])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:1573
isc_c_EventHandler_handleKeyPress([object KeyboardEvent])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:1333
isc_c_EventHandler__handleNativeKeyPress([object KeyboardEvent])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:1328
isc_c_EventHandler_dispatch(isc_c_EventHandler__handleNativeKeyPress,[object KeyboardEvent])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:1636
anonymous([object KeyboardEvent])@http://127.0.0.1:8888/silkroad/sc/modules/ISC_Core.js:63
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.smartgwt.client.widgets.form.fields.ComboBoxItem.getEnteredValue(ComboBoxItem.java)
Comment