You can't mount a form. Only bookmarkable pages can be mounted.
Martijn
On 3/12/08, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to mount forms in my wicket application more appropiate
> URLs. For example I want to replace this:
>
> action="../?wicket:interface=:3:registerpanel:registerForm::IFormSubmitListener::"
>
> with something like this (I'm not sure yet if the version parameter is
> necessary, or whatever that is):
> action="../register/form/?version=3"
>
> What I have so far is this:
>
> In Application#init: mount(new FormMount("/register/action/",
> RegisterPanel.RegisterForm.class));
>
> public class FormMount extends AbstractRequestTargetUrlCodingStrategy {
>
> private final Class<? extends Form> formClass;
>
> public FormMount(String mountPath, Class<? extends Form> formClass) {
> super(mountPath);
> this.formClass = formClass;
> }
>
> public IRequestTarget decode(RequestParameters requestParameters) {
> return null;
> }
>
> public CharSequence encode(IRequestTarget requestTarget) {
> return null;
> }
>
> public boolean matches(IRequestTarget requestTarget) {
> if (requestTarget instanceof IListenerInterfaceRequestTarget)
> {
> IListenerInterfaceRequestTarget target =
> (IListenerInterfaceRequestTarget) requestTarget;
> return
> target.getTarget().getClass().equals(formClass);
> }
> return false;
> }
>
> }
>
> Now, I have no idea how to write the encode and decode
> implementations. The existing implementations are all non-trivial and
> I can't find a way to instantiate the appropiate IRequestTarget.
>
> Thanks for any hints
> Jörn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]