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 8686425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:50:42+00:00 2026-06-12T22:50:42+00:00

When i want to edit a textinputcell, i generally need two clicks : the

  • 0

When i want to edit a textinputcell, i generally need two clicks : the first click gives focus to the cell and then to the input.

I have a celltable with 20 columns, all textinputcell – excel style. And this problem makes it totally unusable.

Here’s a code sample :

FieldUpdater<MyBean, String> fieldUpdater = new FieldUpdater<MyBean, String>() {
  @Override
  public void update(int index, MyBean object, String value) {
    object.setValue(value);
  }
};

Column<MyBean, String> column = new Column<MyBean, String>(new TextInputCell()) {
  @Override
  public String getValue(MyBean object) {
    return objet.getValue();
  }
};

column.setFieldUpdater(fieldUpdater);
table.addColumn(column, "Col");

Did you have to face the problem ? Is there a know solution ?

Thanks

  • 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-06-12T22:50:44+00:00Added an answer on June 12, 2026 at 10:50 pm

    Allright, here’s what i did : I noticed the EditTextCell doesn’t take two clicks to change focus

    So i duplicated the class (everything’s private :/) and i made the following change in the method render :

    Before :

    if (viewData != null) {
      String text = viewData.getText();
      if (viewData.isEditing()) {
        /*
         * Do not use the renderer in edit mode because the value of a text
         * input element is always treated as text. SafeHtml isn't valid in the
         * context of the value attribute.
         */
        sb.append(template.input(text));
      } else {
        // The user pressed enter, but view data still exists.
        sb.append(renderer.render(text));
      }
    } else if (value != null) {
      sb.append(renderer.render(value));
    }
    

    After :

        if (viewData != null) {
            String text = viewData.getText();
            sb.append(template.input(text));
        }
        else if (value != null) {
            sb.append(template.input(value));
        }
    

    I’m only using the template and never the renderer.

    Bonus :
    Since you’re using your own copy of the cell, you can edit the template. I added a width (constructor arg) :

    interface Template extends SafeHtmlTemplates {
        @Template("<input type=\"text\" value=\"{0}\" style=\"width:{1}px\" tabindex=\"-1\"></input>")
        SafeHtml input(String value, String width);
    }
    

    And i call the template like this : sb.append(template.input(text, width));

    Hope that helps 🙂

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

Sidebar

Related Questions

I want to edit controls with contextmenu. When i click right click, i need
I want to edit links when the user changes the value of a <input
I have an UIImage that I want to edit (say, make every second row
I have an html page that I want to edit. I want to remove
I want to edit the cell not its value but its background color. I
Using jsf I want to edit a employee profile, when user will click on
We have some document on the server and want to edit thru asp.net application.
I have a function that is recursive in C# that i want to edit
I have a grid with multiple cols & rows. I want edit just one
I want to edit corresponding labels when the user selects a row. i have

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.