Adding GMap to wicket TabbedPanel

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Adding GMap to wicket TabbedPanel

     I have a tabbed panel where I am trying to add gmap to one of the tab but havent been successful in launching map from the tab.

public class SimpleMap extends GMap
  private static final long serialVersionUID = 1L;
  final static String API_KEY = "MY_API_KEY";
    public SimpleMap(String id,TabbedPanelPage parent)
       super(id, new GMapHeaderContributor(API_KEY));
       this.setCenter(new GLatLng(52.47649, 13.228573));    
<html xmlns=""
                xmlns:wicket="" xml:lang="en"
<title>Host Location Map</title>
<script type='text/javascript' src=''></script></head>

    <div wicket:id="panel" class="panel"  style="height: 4000px"> 
 <script type='text/javascript' src='<MY_API_KEY>callback=initMap'></script> 

In My tabbedPanel class,

 I am adding instance of SimpleMap
tabs.add(new AbstractTab(new Model("third tab"))
            public Panel getPanel(String panelId)
            System.out.println("Adding GMap Panl *** ");
            return new SimpleMap(panelId,TabbedPanelPage.this);
 add(new AjaxTabbedPanel("tabs", tabs)

I keep getting the error below

 ERROR [org.apache.wicket.MarkupContainer.renderNext(1472)] Unable to find component with id 'panel' in [SimpleMap [Component id = panel]]
        Expected: 'tabs:panel.panel'.
        Found with similar names: 'tabs:panel'

Appreciate your help. I am quite new to UI and wicket