wicketwicket-6wicket-1.5

How to load resource bundle for inner class? using wicket 6.6


Unable to find property: 'registerform.agencyName.Required' for component:  [class=com.brazil.clasadm.application.AppnRegister$AppnRegisterForm].

My scenario is like:

public class AppnRegister extends someotherClass {

        public AppnRegister() {
            add(new AppnRegisterForm("registerform"));
        }
        class AppnRegisterForm extends Form {
        TextField agencyName= null;
        agencyName = new TextField("agencyName", new PropertyModel(cac, "agencyName"));
    agencyName .getLocalizer().getString("registerform.agencyName.Required", this);
        }
        }

I tried by adding the resource bundle by the names of AppnRegisterForm.properties, AppnRegister$AppnRegisterForm.properties and all in the same place of where the AppnRegister.java is present. But I unable to clear this issue. Any suggestions on this issue?


Solution

  • What is AppnRegister ? It must be a Wicket MarkupContainer but there is no extends ... in your code!

    The inner class should be static to be able to reach it with AppnRegister$AppnRegisterForm.

    Solutions:

    Both should be next to AppnRegister.class in the classpath.