Problem creating Editor

179 views
Skip to first unread message

jmbz84

unread,
Jan 14, 2012, 8:46:08 PM1/14/12
to Google Web Toolkit
Hello,
I´m trying to create a simple app using editors and requestfactory,
but when I try to declare for the first time the editor
(articuloEditor = new ArticuloEditor();) I get the following error:

[ERROR] [tecmovin] - Line 48: No source code is available for type
com.test.tecmovin.widgets.ArticuloEditor; did you forget to inherit a
required module?

The import "import com.test.tecmovin.widgets.ArticuloEditor;" is on
the class that calls the editor.


Any Help?

I'm relying on the DynaTableRF Sample code.

Here is the code for the Editor:


public class ArticuloEditor extends Composite implements
Editor<ArticuloProxy> {

interface Binder extends UiBinder<Widget, ArticuloEditor> {
}


public ArticuloEditor() {
initWidget(GWT.<Binder> create(Binder.class).createAndBindUi(this));
}

@UiField
ValueBoxEditorDecorator<String> id;


@UiField
ValueBoxEditorDecorator<String> titulo;

@UiField
ValueBoxEditorDecorator<String> autor;

}

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:e='urn:import:com.google.gwt.editor.ui.client'>
<ui:style>
.important {
font-weight: bold;
}
.editField {
display: inline;
width: fieldWidth;
}

.rightAlign {
text-align: right;
}

</ui:style>
<g:HTMLPanel>
<div class="{style.rightAlign}">
ID:
<e:ValueBoxEditorDecorator ui:field="id"
stylePrimaryName="{style.editField}">
<e:valuebox>
<g:TextBox stylePrimaryName="{style.editField}" />
</e:valuebox>
</e:ValueBoxEditorDecorator>
<br />
AUTOR:
<e:ValueBoxEditorDecorator ui:field="autor"
stylePrimaryName="{style.editField}">
<e:valuebox>
<g:TextBox stylePrimaryName="{style.editField}" />
</e:valuebox>
</e:ValueBoxEditorDecorator>
<br />
TITULO:
<e:ValueBoxEditorDecorator ui:field="titulo"
stylePrimaryName="{style.editField}">
<e:valuebox>
<g:TextArea stylePrimaryName="{style.editField}" />
</e:valuebox>
</e:ValueBoxEditorDecorator>
<br />
</div>
</g:HTMLPanel>
</ui:UiBinder>

And the code for the class that creates and calls the editor:

public class PersonEditorWorkflow {
interface Binder extends UiBinder<DialogBox, PersonEditorWorkflow>
{
Binder BINDER = GWT.create(Binder.class);
}

interface Driver extends
RequestFactoryEditorDriver<ArticuloProxy, ArticuloEditor> {
}

@UiField
HTMLPanel contents;

@UiField
DialogBox dialog;

@UiField(provided = true)
ArticuloEditor articuloEditor;

private Driver editorDriver;

private ArticuloProxy articulo;

private TestRequestFactory requestFactory;



public PersonEditorWorkflow(TestRequestFactory requestFactory,
ArticuloProxy articulo)
{
this.requestFactory=requestFactory;
this.articulo=articulo;

articuloEditor = new ArticuloEditor(); //////HERE IS THE ERROR
Binder.BINDER.createAndBindUi(this);

}
.
.
.
.
..
}

Thomas Broyer

unread,
Jan 15, 2012, 5:39:56 AM1/15/12
to google-we...@googlegroups.com


On Sunday, January 15, 2012 2:46:08 AM UTC+1, jmbz84 wrote:
Hello,
I´m trying to create a simple app using editors and requestfactory,
but when I try to declare for the first time the editor
(articuloEditor = new ArticuloEditor();) I get the following error:

        [ERROR] [tecmovin] - Line 48: No source code is available for type
com.test.tecmovin.widgets.ArticuloEditor; did you forget to inherit a
required module?

The import "import com.test.tecmovin.widgets.ArticuloEditor;" is on
the class that calls the editor.

Is ArticuloEditor in the "source path"? I.e. do you have a gwt.xml in com.test.tecmovin.widgets or com.test.tecmovin with an appropriate <source> element in it (either <source path=''/> or <source path='widgets' />)

jmbz84

unread,
Jan 15, 2012, 8:09:26 PM1/15/12
to Google Web Toolkit
Thomas, Yes that did the trick . Thank You.

I have another problem , it seems it is not possible to create a
ValueBoxEditorDecorator of the type Integer, I get the error:
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be
cast to java.lang.String
at com.google.gwt.text.shared.testing.PassthroughRenderer.rende

I tried using a TextBox but I also get an error:
Caused by: java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from Integer to String

Using a Label gets me the error:
Caused by: java.lang.RuntimeException: Deferred binding failed for
'com.test.tecmovin.widgets.ArticuloEditor$Binder' (did you forget to
inherit a required module?)


How can I edit an Integer, which widget should I use ??

**I know the Integer is the problem because when I hide it from the ui
the editor works fine.
**In the DunatableRf there are only String field editors

Thomas Broyer

unread,
Jan 15, 2012, 8:12:45 PM1/15/12
to google-we...@googlegroups.com
You have to use an IntegerBox, not a TextBox.

jmbz84

unread,
Jan 15, 2012, 8:32:16 PM1/15/12
to Google Web Toolkit
Thank You again Thomas. The editor works perfectly
Reply all
Reply to author
Forward
0 new messages