Hi Martin,
Thanks for the tip! This is an interesting approach as well.
On 22/02/2012 2:49 AM, Martin Grigorov wrote:
HI Bertrand,
I'm not quite sure whether this is your concern but take a look at
org.apache.wicket.markup.html.tree.BaseTree#newLink()
It uses LinkType to decide what kind of
Hi,
I want to reuse the same form panels in different contexts and would
like to know how fellow Wicket users achieve this. The core of the
problem is how to let the user of a form panel specify where to
navigate when the form is submitted or canceled.
There are multiple possibilities for
*abstract* class myformpanel extends panel {
public myformpanel(string id) {
add(new button(save) {
onsubmit() {
*onsave(model);*
});}
*protected abstract void onsave(imodel);*
}
add(new myformpanel(panel) {
protected void onsave(imodel) {
// do stuff
Thanks Igor. This is actually very close to what I used as my first
approach. The problem I had then was that depending on the context in
which the panel is used, the component must be one of the following:
1-A Link/Button, like in your code
2-A BookmarkablePageLink
3-An AjaxLink (ajax
HI Bertrand,
I'm not quite sure whether this is your concern but take a look at
org.apache.wicket.markup.html.tree.BaseTree#newLink()
It uses LinkType to decide what kind of Link to create. You can use
the same approach.
On Wed, Feb 22, 2012 at 6:12 AM, Bertrand Guay-Paquet