I'm not convinced yet that this is really a good idea (how to deal with 
constructor arguments for validators? What is the advantage of having all in 
html effectively?) but as a starting point you could look at 
AbstractMarkupFilter (e.g. see how WicketRemoveTagHandler and other 
implementations work).

To add your own MarkupFilter implementation, do the following:


public class MyMarkupFactory extends MarkupFactory {

    @Override
    public MarkupParser newMarkupParser(MarkupResourceStream resource) {
        final MarkupParser markupParser = super.newMarkupParser(resource);
        markupParser.add(new MyMarkupFilter());
        return markupParser;
    }

}

and register MyMarkupFactory in your Application class:

@Override
public void init() {
    super.init();
    getMarkupSettings().setMarkupFactory(new MyMarkupFactory());
}


Cheers,
   -Tom



On 28.05.2012, 21:25h Fernando Wermus wrote:

> Hi all,
>     I was wondering if there is some solution already done like this:
> 
> <input type="text" wicket:id="txtMyTextField"  *
> wicket:fieldtype="java.lang.String"*
> *wicket:validators="com.mycompany.MyValidator1,
> com.mycompany.MyValidator2"* />
> 
> The idea is that HTML is allright for rendering, but It lacks  some
> behaviors. Therefore , instead of making up another markup, there is the
> chance to decorate with wicket behaviors and validators.
> 
> This is flexible enough to have differents specifications and
> implementation to rich HTML.
> 
> The idea we have at my work is to allow junior programmers to design mockup
> pages for funcitonal analyst without adding a line of code. We were mocking
> up pages with Adobe Flex and would like to have this behaviour with wicket.
> 
> thanks in advance
> 
> Fernando Wermus.
> 
> www.linkedin.com/in/fernandowermus


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

Reply via email to