To make things a little clearer.
Here a small example, which does not work as it is supposed to do at least
for my understanding.
public class FormBorder extends Border
{
private Form form;
public FormBorder( final String id )
{
super( id );
super.add( form = new Form( "form" ) );
}
public MarkupContainer add( final Component child )
{
form.add( child );
return this;
}
}
<wicket:border>
<form wicket:id="form">
<wicket:body/>
</form>
</wicket:border>
------------------------------------------------------
public class HomePage extends WebPage
{
private Border formBorder;
public HomePage()
{
add( formBorder = new FormBorder( "border" ) );
formBorder.add( new TextField( "name" ) );
}
}
<html>
<body>
<span wicket:id="border">
<input type="text" wicket:id="name">
</span>
</body>
</html>
I get: wicket.markup.MarkupException: Unable to find component with id
'name' in [MarkupContainer [Component id = border, ...
Why does Wicket try to lookup the input field in the border component and
not in the form?
I was expecting that the <wicket:body/> tag would be replaced with the input
field.
Is this a bug, or am I missing something?
-----Ursprüngliche Nachricht-----
Von: Denzel, Jürgen [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 5. Oktober 2005 09:38
An: [email protected]
Betreff: AW: [Wicket-user] Component nesting problem (bug???)
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