Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required field with no message shows empty tooltip #35

Open
aalmiray opened this issue Jul 19, 2018 · 0 comments
Open

Required field with no message shows empty tooltip #35

aalmiray opened this issue Jul 19, 2018 · 0 comments

Comments

@aalmiray
Copy link
Contributor

Setting a field with required(true) and no error message displays an empty tooltip when the field has no value. See attached screenshot

formsfx-tooltip

Here's the code that can reproduce the problem

import com.dlsc.formsfx.model.structure.Field;
import com.dlsc.formsfx.model.structure.Form;
import com.dlsc.formsfx.model.structure.Group;
import com.dlsc.formsfx.view.renderer.FormRenderer;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Sample extends Application {
   @Override
   public void start(Stage stage) throws Exception {
      StringProperty p1 = new SimpleStringProperty("p1");
      StringProperty p2 = new SimpleStringProperty("p2");
      StringProperty p3 = new SimpleStringProperty("p3");
      StringProperty p4 = new SimpleStringProperty("p4");

      Form form = Form.of(
            Group.of(
                  Field.ofStringType(p1)
                        .label("P1")
                        .required(true),
                  Field.ofStringType(p2)
                        .label("P2")
                        .required(true),
                  Field.ofStringType(p3)
                        .label("P3")
                        .required(true),
                  Field.ofStringType(p4)
                        .label("P4")
                        .required(true)
            )
      );
      stage.setScene(new Scene(new FormRenderer(form)));
      stage.sizeToScene();
      stage.show();
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant