Hi!

One more benefit for MashupWebPage is that you can use it for creating tests:

public void testSomeFieldComponent() {
   Page page = new MashupWebPage();
   Form form;
   page.add(form = new MashUpForm(GID));
   FormComponent customField;
   form.add(customField = new CustomFieldToBeTested(GID));
   tester.startPage(page);
   FormTester formtester = tester.newFormTester(form.getPageRelativePath());
   formtester.setValue(getRelativePath(form, customField), "test-value");
   formtester.submit();
   tester.assertNoErrorMessages();
}

No need to hassle to build a dummy page with boring html markup to
test a formcomponent.

Ofcourse this is just a simple example and more versatile examples can be made.

**
Martin

2010/3/10 Martin Makundi <martin.maku...@koodaripalvelut.com>:
> Hi!
>
>> Could you help me with some examples?
>
> In what way?
>
> Normally you have a panel like this:
>
> <html>
> <button wicket:id="button"/>
> </html>
> class Panel {
>  add(new Button("button"));
> }
>
> You cannot change the panel content flexibly at runtime.
>
> Now if you have a MashupContainer you can do:
>
> mashupContainer.add(new Button());
> mashupContainer.add(new Panel());
> if (privileged) {
>  mashupContainer.add(new GoogleMap());
>  mashupContainer.add(new FacebookWidet());
> }
>
> Also you can add new components at runtime via ajax just by saying:
>  mashupContainer.add(new PanelAtRuntime());
>  ajaxRequestTarget.addComponent(mashupContainer);
>
> So you can do pretty much anything with it without having to modify
> HTML at the same time.
>
> **
> Martin
>

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

Reply via email to