override oncomponenttag() of the form and call super followed by
tag.put("action", "whateverurl");

-igor

On Fri, Jul 18, 2008 at 12:56 PM, Brad Fritz
<[EMAIL PROTECTED]> wrote:
>
> I am trying to rewrite an HTML form "action" attribute (for a
> non-Wicket form) inside a Wicket Panel and could use some help.
>
> While converting a large webapp to Wicket, I created a Panel to wrap a
> search form.  The form processing is not handled by Wicket yet.  So in
> my SearchPanel.html, I have something like this:
>
>  <wicket:panel>
>    <form method="get" action="search.do">
>      [..]
>    </form>
>    <a href="search.do">Advanced Search</a>
>  </wicket:panel>
>
> The "Advanced Search" href is automatically prefixed with the correct
> number of "../" strings by RelativePathPrefixHandler, but the form
> action is not rewritten.
>
> Is adding a new IMarkupFilter (based on RelativePathPrefixHandler) to
> handle the "action" attribute rewriting a good option?  Or is there a
> better way?
>
> My first attempt was using a wicket:message for the action along with
> getRelativePathPrefixToContextRoot() inside SearchPanel.java to set
> the message.  That turned out to be more complicated than I
> expected...but mostly because I was not able to find a simple hook
> into the message lookup from the SearchPanel class to set the message
> text.  (Putting the URL in SearchPanel.properties worked fine but did
> not allow for dynamically prefixing the action URL based on the
> request URL.)
>
> Any ideas on how to best handle this scenario would be much
> appreciated.  Thanks!
>
> --Brad
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to