Re: [Wicket-user] replace a component by clicking on an Ajax link.

2006-05-03 Thread Martijn Dashorst
Put your form into a panel. This works, but I haven't looked at versioning (yet).public class Index extends QuickStartPage { private Panel panel; /** * Constructor that is invoked when page is invoked without a session.
 * * @param parameters Page parameters */ public Index(final PageParameters parameters) { panel = new MyPanel1(panel); panel.setOutputMarkupId(true); add(panel);
 add(new AjaxLink(ajax) { public void onClick(final AjaxRequestTarget target) { if (panel instanceof MyPanel1) panel = new MyPanel2(panel);
 else panel = new MyPanel1(panel); getPage().replace(panel); target.addComponent(panel); } }); }
}On 5/3/06, Potje rode kool [EMAIL PROTECTED] wrote:
Hi,I have a page with some links on the left side of the page, on the right side of the page I want to display a form.Depend on which link is clicked I want to display another form (so replace the old form by a new one).
While working with normal links this is no problem but I wanted to use ajax links so only the right side of the page gets updated.So my question is, how do I this?Thanks in advance.Evert

-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!-- http://wicketframework.org


Re: [Wicket-user] replace a component by clicking on an Ajax link.

2006-05-03 Thread Igor Vaynberg
versioning doesnt come into play because ajax requests are ignored by the back button.-IgorOn 5/3/06, Martijn Dashorst 
[EMAIL PROTECTED] wrote:Put your form into a panel. This works, but I haven't looked at versioning (yet).
public class Index extends QuickStartPage { private Panel panel; /** * Constructor that is invoked when page is invoked without a session.
 * * @param parameters Page parameters */ public Index(final PageParameters parameters) { panel = new MyPanel1(panel); panel.setOutputMarkupId(true); add(panel);
 add(new AjaxLink(ajax) { public void onClick(final AjaxRequestTarget target) { if (panel instanceof MyPanel1) panel = new MyPanel2(panel);
 else panel = new MyPanel1(panel); getPage().replace(panel); target.addComponent(panel); } });
 }
}On 5/3/06, Potje rode kool 
[EMAIL PROTECTED] wrote:

Hi,I have a page with some links on the left side of the page, on the right side of the page I want to display a form.Depend on which link is clicked I want to display another form (so replace the old form by a new one).
While working with normal links this is no problem but I wanted to use ajax links so only the right side of the page gets updated.So my question is, how do I this?Thanks in advance.Evert

-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!
-- http://wicketframework.org




Re: [Wicket-user] replace a component by clicking on an Ajax link.

2006-05-03 Thread Potje rode kool
Its working :D.Thanks!2006/5/3, Martijn Dashorst [EMAIL PROTECTED]:
Put your form into a panel. This works, but I haven't looked at versioning (yet).public class Index extends QuickStartPage { private Panel panel; /** * Constructor that is invoked when page is invoked without a session.
 * * @param parameters Page parameters */ public Index(final PageParameters parameters) { panel = new MyPanel1(panel); panel.setOutputMarkupId(true); add(panel);
 add(new AjaxLink(ajax) { public void onClick(final AjaxRequestTarget target) { if (panel instanceof MyPanel1) panel = new MyPanel2(panel);
 else panel = new MyPanel1(panel); getPage().replace(panel); target.addComponent(panel); } });
 }
}On 5/3/06, Potje rode kool 
[EMAIL PROTECTED] wrote:
Hi,I have a page with some links on the left side of the page, on the right side of the page I want to display a form.Depend on which link is clicked I want to display another form (so replace the old form by a new one).
While working with normal links this is no problem but I wanted to use ajax links so only the right side of the page gets updated.So my question is, how do I this?Thanks in advance.Evert

-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org




Re: [Wicket-user] replace a component by clicking on an Ajax link.

2006-05-03 Thread Igor Vaynberg
do it the same way as with a regular link and add the new panel to the ajax target.-IgorOn 5/3/06, Potje rode kool 
[EMAIL PROTECTED] wrote:Hi,I have a page with some links on the left side of the page, on the right side of the page I want to display a form.
Depend on which link is clicked I want to display another form (so replace the old form by a new one).
While working with normal links this is no problem but I wanted to use ajax links so only the right side of the page gets updated.So my question is, how do I this?Thanks in advance.Evert