I found a workaround to deal with this problem.
public MarkupContainer add( final Component child )
{
form.add( child );
super.add( child );
return this;
}
I put this method in the border component, now it works.
Obviously this is not a proper solution.
-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Auftrag von Juergen
Donnerstag
Gesendet: Mittwoch, 5. Oktober 2005 14:13
An: [email protected]
Betreff: Re: [Wicket-user] Component nesting problem (bug???)
This is true, but "name" must be a child of the border, otherwise
Wicket won't find it. This is because wicket:id="name" is declared in
the border component. That is one of wicket's guiding principles:
markup and the associate java must match; no magic. Possible
solutions: put the <form> tag outside the border (not between
<wicket:border> and <wicket:body>) or try markup inheritance
I'd suggest, because from a users (and ease of use) point of view,
that name and firstname should be made "visible" to the form. I've no
clue yet how to do, but IOM it is worth thinking about it. And to be
clear, IMO It is no option to implement an exception like "if form is
inside border than user don't add children to the border but the
form".
Mind you open an RFE for it please. Thanks
Juergen
On 10/5/05, Denzel, Jürgen <[EMAIL PROTECTED]> wrote:
> That won't help because the fields must be added to the form otherwise the
> submitted values will not be set properly
> on the model. At least that was my experience when I tried this before.
>
> jd
>
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag von Juergen
> Donnerstag
> Gesendet: Mittwoch, 5. Oktober 2005 11:35
> An: [email protected]
> Betreff: Re: [Wicket-user] Component nesting problem (bug???)
>
>
> "name" and "firstname" must not be added to Form but rather to the
> border component "menuBorder"
>
> Juergen
>
> On 10/5/05, Denzel, Jürgen <[EMAIL PROTECTED]> wrote:
> > The code is based on the navmenu example. What we need is a tabbed pane,
> > where each tab
> > contains a form.
> >
> > All tabs extends this class.
> >
> > public abstract class AbstractTabsPage extends PageWithMenu
> > {
> > private Form form;
> >
> > public AbstractTabsPage(final PageParameters parameters)
> > {
> > super();
> > this.form = new Form( "tabForm" );
> > add( this.form );
> > }
> >
> > public void addToForm( final Component child )
> > {
> > this.form.add( child );
> > }
> >
> > public String getVariation()
> > {
> > return getRequestCycle().getRequest().getParameter( "page" );
> > }
> > }
> >
> > A page looks e.g. like this:
> >
> > public class TabsPage extends AbstractTabsPage
> > {
> > /**
> > * Constructor.
> > * @param parameters Page parameters
> > */
> > public Home(final PageParameters parameters)
> > {
> > super( parameters );
> > Login login = new Login();
> > addToForm( new TextField( "name", new PropertyModel( login,
> > "name" ) ) );
> > addToForm( new TextField( "firstname", new PropertyModel( login,
> > "firstname" ) ) );
> > }
> >
> > ...
> > ..
> > .
> >
> > What's wrong with this code?
> > Thanks.
> > jd
> >
> > -----Ursprüngliche Nachricht-----
> > Von: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Auftrag von Eelco
> > Hillenius
> > Gesendet: Mittwoch, 5. Oktober 2005 08:39
> > An: [email protected]
> > Betreff: Re: [Wicket-user] Component nesting problem (bug???)
> >
> >
> > What does the rest of your code look like/ how do you add the inputs
> > to the form to the border?
> >
> > Eelco
> >
> > On 10/5/05, Denzel, Jürgen <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > I encountered the following problem when nesting components and using
> the
> > > <wicket:body/> tag.
> > > My markup looks like this:
> > >
> > > <span wicket:id="menuBorder">
> > > Name: <input type="text" wicket:id="name"><br>
> > > Firstname: <input type="text" wicket:id="firstname"><br>
> > > </span>
> > >
> > > The border component is this:
> > >
> > > <wicket:border>
> > > <span wicket:id="navigationMenu" />
> > > <div id="tabContent">
> > > <form wicket:id="menuForm">
> > > <wicket:body/>
> > > </form>
> > > </div>
> > > </wicket:border>
> > >
> > > When accessing the page I get the following error:
> > >
> > > wicket.markup.MarkupException: Unable to find component with id 'name'
> in
> > > [MarkupContainer [Component id = menuBorder, page =
> > > wicket.examples.navmenu.Home, path = 0:menuBorder.MenuBorder,
isVisible
> =
> > > true, isVersioned = true]].
> > >
> > > I was expecting that the <wicket:body/> tag would be replaced by the
> > "name"
> > > and "firstname" input fields and Wicket would look
> > > up these fields in the surrounding form component. In my class I added
> the
> > > fields to the form correctly.
> > >
> > > Is this supposed to be so or is it a bug.
> > >
> > > Greets,
> > > jd
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by:
> > > Power Architecture Resource Center: Free content, downloads,
> discussions,
> > > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > > _______________________________________________
> > > Wicket-user mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by:
> > Power Architecture Resource Center: Free content, downloads,
discussions,
> > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by:
> > Power Architecture Resource Center: Free content, downloads,
discussions,
> > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user