Hi Alec,

I don't think Wicket has a configuration option that can help you. But you can create a web page superclass that parses HTML and adds your form if it finds tag <div wicket:id="creditCardForm"/>. For example you can override onInitialize method and add something like this:

MarkupParser markupParser = new MarkupParser(new XmlPullParser(), new MarkupResourceStream(getMarkupStream().getResource()));
Markup markup = markupParser.parse();

for(int i = 0; i < markup.size(); i++) {
            if(markup.get(i) instanceof ComponentTag){
                String markupId = (ComponentTag) markup.get(i);
                //if markupid is equals to "creditCardForm" add form


I would like to add credit card processing form to many different pages in
my application. However, I don't know which pages it will be added to and it
is up to the web designer to decide.

I would like to allow the web designer to be able to put<div
wicket:id="creditCardForm"/>  anywhere in HTML. This would typically cause
Wicket to throw an error saying that a matching component was not added.

Is there a way to configure Wicket to somehow add an instance of
CreditCardForm class whenever it sees<div wicket:id="creditCardForm"/>?



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

Reply via email to