Skip to content

Can not render the action button when use ActionButtonTextField extend! #2

@tuvd08

Description

@tuvd08
  • I add the new from and use the navigation (com.vaadin.navigator.Navigator) to open it:
public class MyUI extends UI {
//
  protected void init(VaadinRequest vaadinRequest) {
    new Navigator(this, this);
    getNavigator().addView(MyForm.NAME, MyForm.class);
    getNavigator().navigateTo(MyForm.NAME);
    //...
  }
}
// class MyForm
public class MyForm extends CustomComponent implements View, Button.ClickListener {
  public static final String NAME = "myform";
  public AccountForm() {
    setSizeFull();
    TextField textField = new TextField("My Field");

    ActionButtonTextField buttonTextField = ActionButtonTextField.extend(textField);
      buttonTextField.getState().type =  ActionButtonType.ACTION_SEARCH;
      buttonTextField.addClickListener(new ActionButtonTextField.ClickListener() {
        @Override
        public void buttonClick(ActionButtonTextField.ClickEvent clickEvent) {
          clickEvent.getTextField().setValue("The value after click");
        }
      });
    VerticalLayout fields = new VerticalLayout(textField);
    setCompositionRoot(fields);
  }
//...
}

But, after run by jetty:run, I see only the text-field rendered on UI, do not see any action (button) on UI. And see on console of browser or debug of Vaadin I saw error:

Sat Apr 18 01:24:53 GMT+700 2015 com.vaadin.client.VConsole
SEVERE: Hierachy claims TextFieldConnector (51) has component children even though it isn't a HasComponentsConnector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions