Search in sources :

Example 1 with AjaxTab

use of com.googlecode.wicket.jquery.ui.widget.tabs.AjaxTab in project openmeetings by apache.

the class SettingsPanel method onInitialize.

@Override
protected void onInitialize() {
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AjaxTab(Model.of(getString("1170"))) {

        private static final long serialVersionUID = 1L;

        UserProfilePanel profilePanel = null;

        @Override
        protected WebMarkupContainer getLazyPanel(String panelId) {
            if (profilePanel == null) {
                profilePanel = new UserProfilePanel(panelId, getUserId());
                profilePanel.setOutputMarkupId(true);
            }
            return profilePanel;
        }

        @Override
        public boolean load(AjaxRequestTarget target) {
            if (profilePanel != null) {
                profilePanel.setDefaultModelObject(userDao.get(getUserId()));
                target.add(profilePanel);
            }
            return super.load(target);
        }
    });
    tabs.add(new AjaxTab(Model.of(getString("1188"))) {

        private static final long serialVersionUID = 1L;

        @Override
        protected WebMarkupContainer getLazyPanel(String panelId) {
            return new MessagesContactsPanel(panelId);
        }
    });
    tabs.add(new AbstractTab(Model.of(getString("1171"))) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new ProfilePanel(panelId);
        }
    });
    tabs.add(new AbstractTab(Model.of(getString("1172"))) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new UserSearchPanel(panelId);
        }
    });
    tabs.add(new AbstractTab(Model.of(getString("1548"))) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new WidgetsPanel(panelId);
        }
    });
    add(new TabbedPanel("tabs", tabs, new Options("active", active)).setActiveTab(active));
    super.onInitialize();
}
Also used : Options(com.googlecode.wicket.jquery.core.Options) ArrayList(java.util.ArrayList) TabbedPanel(com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxTab(com.googlecode.wicket.jquery.ui.widget.tabs.AjaxTab) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab)

Aggregations

Options (com.googlecode.wicket.jquery.core.Options)1 AjaxTab (com.googlecode.wicket.jquery.ui.widget.tabs.AjaxTab)1 TabbedPanel (com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel)1 ArrayList (java.util.ArrayList)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)1 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1