You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ChambreNoire <aw...@tentelemed.com> on 2012/09/25 09:15:16 UTC

Separating a form

Hi,

I have a simple ContactEditPanel which contains a form and a number of
textfields. Up until now I included an AjaxSubmitLink in this panel which,
if the form content is valid, saves/updates the Contact instance contained
in the Panel model. So far so simple. However now I'd like to remove the
link in order that I may, depending on the context in which I use the
ContactEditPanel, place the submit link at different levels of my overall
component hierarchy. For instance in one context I'd like to use to flip
between ContactEditPanel and ContactViewPanel with a bar of actions above
the current view (edit | save , cancel). Another context would be to use
ContactEditPanel in a standalone way (maybe part of a multi-step process)
with just a save link below.

I was contemplating refactoring my ContactEditPanel to extends
FormComponentPanel rather than Panel as described here but I'm not sure
whether this is the right approach and I'm having trouble wrapping my head
around this.

Any help would be most appreciated!

Many Thanks,

CN




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Separating-a-form-tp4652301.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Separating a form

Posted by ChambreNoire <aw...@tentelemed.com>.
I'm afraid I don't quite understand your explanation. If you have the time
some code snippets might be helpful.

Many Thanks,

CB



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Separating-a-form-and-its-AjaxSubmitLinks-tp4652301p4652339.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Separating a form

Posted by Francois Meillet <fr...@gmail.com>.
Why not using the event handling mechanism ?

A small idea : you can use a specific event as a constructor's argument for ContactEditPanel.
This event would contain all the necessary information for the display,
(what and where) and will also be resent by the onSubmit method.

The listeners of this event will perform the post processing logic.

François

Le 25 sept. 2012 à 09:15, ChambreNoire <aw...@tentelemed.com> a écrit :

> Hi,
> 
> I have a simple ContactEditPanel which contains a form and a number of
> textfields. Up until now I included an AjaxSubmitLink in this panel which,
> if the form content is valid, saves/updates the Contact instance contained
> in the Panel model. So far so simple. However now I'd like to remove the
> link in order that I may, depending on the context in which I use the
> ContactEditPanel, place the submit link at different levels of my overall
> component hierarchy. For instance in one context I'd like to use to flip
> between ContactEditPanel and ContactViewPanel with a bar of actions above
> the current view (edit | save , cancel). Another context would be to use
> ContactEditPanel in a standalone way (maybe part of a multi-step process)
> with just a save link below.
> 
> I was contemplating refactoring my ContactEditPanel to extends
> FormComponentPanel rather than Panel as described here but I'm not sure
> whether this is the right approach and I'm having trouble wrapping my head
> around this.
> 
> Any help would be most appreciated!
> 
> Many Thanks,
> 
> CN
> 
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Separating-a-form-tp4652301.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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


Re: Separating a form

Posted by Francois Meillet <fr...@gmail.com>.
In ContactEditPanel, you can have a constructor with the AjaxSubmitLink as an argument.
Hope that help,

François




Le 25 sept. 2012 à 09:15, ChambreNoire <aw...@tentelemed.com> a écrit :

> Hi,
> 
> I have a simple ContactEditPanel which contains a form and a number of
> textfields. Up until now I included an AjaxSubmitLink in this panel which,
> if the form content is valid, saves/updates the Contact instance contained
> in the Panel model. So far so simple. However now I'd like to remove the
> link in order that I may, depending on the context in which I use the
> ContactEditPanel, place the submit link at different levels of my overall
> component hierarchy. For instance in one context I'd like to use to flip
> between ContactEditPanel and ContactViewPanel with a bar of actions above
> the current view (edit | save , cancel). Another context would be to use
> ContactEditPanel in a standalone way (maybe part of a multi-step process)
> with just a save link below.
> 
> I was contemplating refactoring my ContactEditPanel to extends
> FormComponentPanel rather than Panel as described here but I'm not sure
> whether this is the right approach and I'm having trouble wrapping my head
> around this.
> 
> Any help would be most appreciated!
> 
> Many Thanks,
> 
> CN
> 
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Separating-a-form-tp4652301.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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