Broken editor type conversions in GWT trunk r10227

52 views
Skip to first unread message

Miroslav Genov

unread,
May 26, 2011, 9:42:11 AM5/26/11
to google-we...@googlegroups.com
Hello,
I'm trying to use trunk version of GWT but I'm encountering some conversion issues with the Editor framework. 

Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at com.google.gwt.text.shared.testing.PassthroughRenderer.render(PassthroughRenderer.java:1)
at com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:394)
at com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:389)
at com.google.gwt.editor.ui.client.adapters.ValueBoxEditor.setValue(ValueBoxEditor.java:106)
at com.google.gwt.editor.client.impl.Refresher.visit(Refresher.java:45)
at com.google.gwt.editor.client.impl.Initializer.visit(Initializer.java:49)
at com.google.gwt.editor.client.impl.AbstractEditorContext.traverse(AbstractEditorContext.java:128)
at com.clouway.requestfactory.app.client.CustomerEditor_RequestFactoryEditorDelegate.accept(CustomerEditor_RequestFactoryEditorDelegate.java:54)
at com.google.gwt.editor.client.impl.AbstractEditorContext.traverse(AbstractEditorContext.java:129)
at com.clouway.requestfactory.app.client.CustomerEditorWorkflow_DriverImpl.accept(CustomerEditorWorkflow_DriverImpl.java:6)
at com.google.gwt.editor.client.impl.BaseEditorDriver.doEdit(BaseEditorDriver.java:92)
at com.google.web.bindery.requestfactory.gwt.client.impl.AbstractRequestFactoryEditorDriver.edit(AbstractRequestFactoryEditorDriver.java:178)

The AbstractEditorDriverGenerator is generating different AbstractEditorContext for each property of the entity, so the following declaration:
  @UiField
  ValueBoxEditorDecorator<Integer> age;

  Age:
      <e:ValueBoxEditorDecorator ui:field="age">
        <e:valuebox>
          <g:TextBox/>
        </e:valuebox>
      </e:ValueBoxEditorDecorator>

generates AbstractEditorContext for "age" field as 
    @Override public Class getEditedType() { return java.lang.Integer.class; }
  @Override public java.lang.Integer getFromModel() {
    return (parent != null && true) ? parent.getAge() : null;
  }

And here is the problem, the   TextBoxBase class is using the default PassthroghtParser (of type String)

protected TextBoxBase(Element elem) {
  super(elem, PassthroughRenderer.instance(), PassthroughParser.instance());
}
which is causing the provided exception. Any idea how I can make it working ?

Nachiket

unread,
Jul 19, 2011, 8:22:31 AM7/19/11
to Google Web Toolkit
No response on this??
i am also facing similar problem

On May 26, 6:42 pm, Miroslav Genov <mge...@gmail.com> wrote:
> Hello,
> I'm trying to use trunk version of GWT but I'm encountering some conversion
> issues with the Editor framework.
>
> Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to
> java.lang.String
> at
> com.google.gwt.text.shared.testing.PassthroughRenderer.render(PassthroughRe nderer.java:1)
> at
> com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:394)
> at
> com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:389)
> at
> com.google.gwt.editor.ui.client.adapters.ValueBoxEditor.setValue(ValueBoxEd itor.java:106)
> at com.google.gwt.editor.client.impl.Refresher.visit(Refresher.java:45)
> at com.google.gwt.editor.client.impl.Initializer.visit(Initializer.java:49)
> at
> com.google.gwt.editor.client.impl.AbstractEditorContext.traverse(AbstractEd itorContext.java:128)
> at
> com.clouway.requestfactory.app.client.CustomerEditor_RequestFactoryEditorDe legate.accept(CustomerEditor_RequestFactoryEditorDelegate.java:54)
> at
> com.google.gwt.editor.client.impl.AbstractEditorContext.traverse(AbstractEd itorContext.java:129)
> at
> com.clouway.requestfactory.app.client.CustomerEditorWorkflow_DriverImpl.acc ept(CustomerEditorWorkflow_DriverImpl.java:6)
> at
> com.google.gwt.editor.client.impl.BaseEditorDriver.doEdit(BaseEditorDriver. java:92)
> at
> com.google.web.bindery.requestfactory.gwt.client.impl.AbstractRequestFactor yEditorDriver.edit(AbstractRequestFactoryEditorDriver.java:178)

Aidan O'Kelly

unread,
Jul 19, 2011, 8:40:19 AM7/19/11
to google-we...@googlegroups.com
You need to use IntegerBox if you are editing an Integer field, I believe.

<e:valuebox>
<g:IntegerBox />
</e:valuebox>

> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages