Hi,
Following the above I coded a minimalistic example, but I get this exception when I try to display the form. Any clue?
Code:
[ERROR,ApplicationLifecycleAdvisor,AWT-EventQueue-0] component must be showing on the screen to determine its location
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
...
Here is my code:
Create the form from Abeille:
Code:
protected JComponent createFormControl() {
FormPanel formPanel = new FormPanel("main/main.jfrm");
FormAccessor accessor = formPanel.getFormAccessor();
// bind the form components to the form model
getBindingFactory().bindControl(accessor.getTextField("nombre.field"), "nombre");
return formPanel;
}
Pojo Class:
Code:
public class Usuario {
String nombre;
public void setNombre(String value){
this.nombre = value;
}
public String getNombre(){
return nombre;
}
}
And rules:
Code:
private Rules createUsuarioRules() {
return new Rules(Usuario.class) {
protected void initRules() {
add("nombre", required());
}
};
}
It's weird because the exception is raised if I add the "nombre" required rule or if I bind the "nombre.field" component to the "nombre" property. If one of those lines is commented out, no exception is thrown and the form is displayed normally.
Thanks,
Walbar