Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7178735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:58:47+00:00 2026-05-28T16:58:47+00:00

I have implemented my own form field as IsEditor<LeafValueEditor<String>> that I’d like to use

  • 0

I have implemented my own form field as IsEditor<LeafValueEditor<String>> that I’d like to use in the forms of my application.

public class FormField extends Composite implements IsEditor<LeafValueEditor<String>> {

    interface FormFieldUiBinder extends UiBinder<Widget, FormField> {
    }

    private static FormFieldUiBinder uiBinder = GWT.create(FormFieldUiBinder.class);

    interface FormFieldStyle extends CssResource {
        String error();
    }

    @UiField
    TextBox wrapped;

    private String placeholder;

    public FormField() {
        initWidget(uiBinder.createAndBindUi(this));
        wrapped.setTitle("");
    }

    @UiHandler("wrapped")
    public void onFocus(FocusEvent event) {
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
            @Override
            public void execute() {
                wrapped.selectAll();
            }
        });
    }

    public String getText() {
        return wrapped.getText();
    }

    public void setText(String text) {
            wrapped.setText(text);
    }

    /**
     * Gets the current placeholder text for the text box.
     * 
     * @return the current placeholder text
     */
    public String getPlaceholder() {
        return placeholder;
    }

    /**
     * Sets the placeholder text displayed in the text box.
     * 
     * @param placeholder
     *            the placeholder text
     */
    public void setPlaceholder(String text) {
        placeholder = (text != null ? text : "");
        wrapped.getElement().setPropertyString("placeholder", placeholder);
    }

    public String getTitle() {
        return wrapped.getTitle();
    }

    public void setTitle(String title) {
        wrapped.setTitle(title);
    }

    @Override
    public LeafValueEditor<String> asEditor() {
        return wrapped.asEditor();
    }

    public int getVisibleLength() {
        return wrapped.getVisibleLength();
    }

    public void setVisibleLength(int length) {
        wrapped.setVisibleLength(length);
    }

    public boolean isReadOnly() {
        return wrapped.isReadOnly();
    }

    public void setReadOnly(boolean readOnly) {
        wrapped.setReadOnly(readOnly);
    }

    public boolean isEnabled() {
        return wrapped.isEnabled();
    }

    public void setEnabled(boolean enabled) {
        wrapped.setEnabled(enabled);
    }

    public void setWidth(String width) {
        wrapped.setWidth(width);
    }

}

The corresponding UIBinder file is plain simple :

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:g='urn:import:com.google.gwt.user.client.ui'>

    <g:HTMLPanel>
        <g:TextBox ui:field="wrapped" />
    </g:HTMLPanel>
</ui:UiBinder>

This works smoothly in the forms I create like this :

<g:AbsolutePanel width="350px" height="225px"
    styleName="{res.css.inputArea}">
    <g:at left='10' top='0'>
        <g:HTMLPanel width="350px">
            <h1>Personalia</h1>
        </g:HTMLPanel>
    </g:at>
    <g:at left='10' top='65'>
        <f:FormLabel text="voornaam" />
    </g:at>
    <g:at left='10' top='80'>
        <f:FormField ui:field="firstName" placeholder="voornaam" />
    </g:at>
    <g:at left='10' top='115'>
        <f:FormLabel text="achternaam" />
    </g:at>
    <g:at left='10' top='130'>
        <f:FormField ui:field="lastName" placeholder="achternaam"/>
    </g:at>
</g:AbsolutePanel>

In my views, I can then use the EditorDriver like this :

interface EditorDriver extends SimpleBeanEditorDriver<Account, AccountPersonaliaEditor> {
}
private final EditorDriver editorDriver = GWT.create(EditorDriver.class);

And populating the form works fine too

    editorDriver.initialize(editor);
    editorDriver.edit(presenter.getAccount());

As well as getting the values after editing :

Account account = editorDriver.flush();

Now I would like to implement feedback on the errors. I have the GWT Bean validation framework working fine too. I just need to show the errors.

So, what I am trying next, is to have the FormField implement HasEditorErrors. Here is my problem/question.

public class FormField extends Composite implements IsEditor<LeafValueEditor<String>>, HasEditorErrors<String> 

As soon as I implement this interface (even with a empty implementation), I run into the following compile time error :

[DEBUG] [klawtapp] - Rebinding com.example.screen.ui.center.AccountPersonaliaImpl.EditorDriver
    [DEBUG] [klawtapp] - Invoking generator com.google.gwt.editor.rebind.SimpleBeanEditorDriverGenerator
        [DEBUG] [klawtapp] - Creating Editor model for com.example.screen.ui.center.AccountPersonaliaImpl.EditorDriver
            [DEBUG] [klawtapp] - Descending into firstName
                [ERROR] [klawtapp] - Could not find a getter for path wrapped in proxy type java.lang.String
            [DEBUG] [klawtapp] - Descending into lastName
                [ERROR] [klawtapp] - Could not find a getter for path wrapped in proxy type java.lang.String
            [ERROR] [klawtapp] - Unable to create Editor model due to previous errors
[ERROR] [klawtapp] - Deferred binding failed for 'com.example.screen.ui.center.AccountPersonaliaImpl.EditorDriver'; expect subsequent failures

This seemed so trivial. I have tried adding getter/setter for wrapped but that does not really help.

EDIT: for a moment, I thought the solution would be to implement HasEditorErrors<LeafValueEditor<String>> instead of HasEditorErrors<String> to prevent descending the hierarchy to the wrapped TextBox, but the results are similar :

            [ERROR] [klawtapp] - Could not find a getter for path wrapped in proxy type com.google.gwt.editor.client.LeafValueEditor
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:58:48+00:00Added an answer on May 28, 2026 at 4:58 pm

    Simply annotate your wrapped text box with @Editor.Ignore.

    Alternatively, you could remove the implements IsEditor<LeafValueEditor<String>> and instead annotate the wrapped field with @Path("") (you’ll have to test with null values though if you might face them, as I’m not sure it’ll work well as-is).

    Or you could choose to implement your own LeafValueEditor<String> instead of relying on the one from the TextBox.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that can be used without authentication on computers in public
I have my own module and I implemented a hook_menu , I want that
I have an own Tree object implemented in PHP. Say we have a tree
I have written my own Exception (MyException) and implemented Logging and showing Error Messages
I have to implement an Form View, or in other words: A class that
I have a django model that I'm displaying as a form using a ModelForm.
i've made a C# winforms application. Now i have a form which has lots
I have a tree control that implements drag and drop. I use an overridden
I have five textboxes which are associated with its own field from the my
I have implemented my own manual method of switching the app's localization within the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.