Hi,

I've created gentle wrapper components around basic form components like TextField. (I have apply some custom styling, particularly table cells)

For the most part this is easy enough using the nice publishParameters feature:

public class CTextField extends AxAbstractTextInput {
        @Component(
publishParameters = "annotationProvider,clientId,disabled,nulls,translate,value,validate)
        private TextField txtfield;

        public TextField getTextField() { return txtfield; }
        public String getControlName() { return txtfield.getControlName(); }
        public boolean isDisabled() { return txtfield.isDisabled(); }
        public boolean isRequired() { return txtfield.isRequired(); }
        public String getClientId() { return txtfield.getClientId(); }
}



The problem is if I use a regexp validator: it looks up the regexp using the key "txtfield-regexp" and "form-txtfield-regexp" (that is, the ID of the embedded component). Instead of, say, "emailField-regexp". (really, the problem is with any validation: custom error messages are not being pulled from the catalog)


I've tried using the older-style "inherit" parameter binding, like so:

        // ...
        @Component(
publishParameters = "annotationProvider,clientId,disabled,nulls,translate,value",
                parameters = { "validate=inherit:validate" })
        private TextField txtfield;

        @Parameter(defaultPrefix = "validate")
        @Property
        private String validate;
        // ...

With no change (not really surprising). I've looked at the source-code for TextField and AbstractTextField and it appears that there's no way to work around this, but I, of course, barely understand any of it.

Am I missing something obvious? Perhaps wrapping components like this isn't the appropriate way to encode styling? (I use CSS as much as I can, but even things like CSS class names seem nicer encoded within a wrapper component)

Thank you for your help.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to