Also (just for the archives), you really could override this method on
WebMarkupContainer - it doesn't actually need to be a "form" instance since
you're not actually using any form functionality.  You're simply creating a
container that contains markup, and that you can override attributes of the
HTML tag on.

It works either way, but thought I'd throw that in for you.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Fri, Jul 18, 2008 at 4:16 PM, Brad Fritz <[EMAIL PROTECTED]>
wrote:

>
> On Fri, Jul 18, 2008 at 01:14:08PM -0700, Igor Vaynberg wrote:
>
> > override oncomponenttag() of the form and call super followed by
> > tag.put("action", "whateverurl");
>
> Thanks for the pointer, Igor!
>
> For the benefit of archive searchers, the onComponentTag() solution
> required that I add a wicket:id to my form--even though form
> submission is not handled by Wicket.  I also needed to override
> onComponentTagBody() to prevent the Form rendering from adding Wicket
> hidden fields to my form.
>
> Here is a code snippet to illustrate:
>
> public class SearchPanel extends Panel {
>
>    public SearchPanel(String id) {
>        super(id);
>        add(new Form("searchForm") {
>            protected void onComponentTag(ComponentTag tag) {
>                // prefix the form "action" attribute with a relative path
> prefix
>                tag.put(
>                    "action",
>
>  RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot()
>                    + tag.getAttributes().getString("action"));
>            }
>
>            // override the default to suppress the addition of Wicket
> hidden form fields
>            protected void onComponentTagBody(final MarkupStream
> markupStream, final ComponentTag openTag) {
>                renderComponentTagBody(markupStream, openTag);
>            }
>        });
>     }
> }
>
>
> --Brad
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to