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

unable to use @fxml with a java bean when defined in the same project #41

Open
jfilali opened this issue Jan 19, 2017 · 1 comment
Open

Comments

@jfilali
Copy link

jfilali commented Jan 19, 2017

I tried this :

class CustomTag(){
  @BeanProperty var field : String = ""
  override def toString = s"Person: $field"
}

@JSExport
object Foo {
  @fxml def test() = { <CustomTag field="test"/> }
}

[error] java.lang.ClassNotFoundException: sth.pkg.CustomTag
[error] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[error] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[error] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[error] at java.lang.Class.forName0(Native Method)
[error] at java.lang.Class.forName(Class.java:264)
[error] at com.thoughtworks.binding.fxml$Macros.resolvePropertiesForJavaBean(fxml.scala:928)
[error] @FXML def test() = { }

I tried

class CustomTag(@BeanProperty var field:String){
  override def toString = s"Person: $field"
}

sth.pkg.CustomTag is not a Java Bean nor a type built from JavaFXBuilderFactory
[error] @FXML def test() = { }
[error] ^

I also tried to create a regular java class :

public class CustomTag {
    private String field;
    public CustomTag(){

    }

    public CustomTag(String field){
        this.field=field;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }
}

and get java.lang.ClassNotFoundException:

I also tried to add an import next to it :

  @fxml def test() = {
      import sth.pkg.CustomTag


@jfilali
Copy link
Author

jfilali commented Jan 19, 2017

The current workaround is to simply compile the tags inside another project. Using a cross compile project jvm-js doesn't work though.

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