I have an application structured such that I have 2 version for header
panels. One for anonymous(HeaderPanel) users and one for
authenticated(AuthenticatedHeaderPanel) users. Both of these are Panels
included in their respective pages.

Now I added another Panel (SearchPanel. It contains a Form) inside the
AuthenticatedHeaderPanel, then included the AuthenticatedHeaderPanel inside
a Page (ProfilePage). Somehow, the ProfilePage couldn't find the markups in
the SearchPanel.

AuthenticatedHeaderPanel.java
---------------------------------------------
public class AuthenticatedHeaderPanel extends Panel {

  public AuthenticatedHeaderPanel(String id, IModel<?> model) {
    super(id, model);
    add(new SearchPanel("searchPanel"));
  }
}

AuthenticatedHeaderPanel.html
----------------------------------------------
<div wicket:id="searchPanel"></div>

SearchPanel.java
-------------------------
public class SearchPanel extends Panel {

  public SearchPanel(String id) {
    super(id);
    Form loginForm = new Form("searchForm") {

    };
    add(loginForm);
    loginForm.add(new TextField("searchtextfield"));
  }
}

SearchPanel.html
-------------------------
<wicket:panel>
  <form wicket:id="searchForm">
    <input wicket:id="searchtextfield" type="text" />
    <input type="submit" />
  </form>
<wicket:panel>

AuthenticatedBasePage.java
------------------------------------------
public class AuthenticatedBasePage extends WebPage {

  public AuthenticatedBasePage() {
    super();
    add(new AuthenticatedHeaderPanel("state-header", new Model("")));
  }
}

ProfilePage.html
------------------------
<span wicket:id="state-header" />

ProfilePage.java
-----------------------
public class ProfilePage extends AuthenticatedBasePage {

  public ProfilePage() {
    super();
  }
}

What could I be doing wrong?

Thanks

-- 
Odeyemi 'Kayode O.
http://ng.linkedin.com/in/kayodeodeyemi. t: @charyorde blog:
http://sinati.com/tree/java-cheat-sheet

Reply via email to