Wicket Panel inside of a Fragment

Ivan

Is it possible to add panel inside of a Fragment (fragment is used on a page which inherited other page), so I was using tag also)?

blalasaadri

Yes, it is. Here's a simple example:

Page:

package com.mycompany;

import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.WebPage;

public class HomePage extends WebPage {

    public HomePage(final PageParameters parameters) {
        super(parameters);

        Fragment fragment = new Fragment("fragment", "fragment-markup", this);

        fragment.add(new MyPanel("panel"));

        add(fragment);
    }
}

Page markup:

<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
    <body>
        <div wicket:id="fragment"/>

        <wicket:fragment wicket:id="fragment-markup">
            <div wicket:id="panel"/>
        </wicket:fragment>
    </body>
</html>

Panel:

package com.mycompany;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;

public class MyPanel extends Panel {

    public MyPanel(String id) {
        super(id);

        add(new Label("hello", Model.of("Hello")));
        add(new Label("world", Model.of("World")));
    }

}

Panel markup:

<!DOCTYPE html>
<html>
<body>
    <wicket:panel>
        <div wicket:id="hello"/>
        <div wicket:id="world"/>
    </wicket:panel>
</body>
</html>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Refresh panel in Wicket with BootstrapDownloadLink

From Dev

Title for Tabbed Panel in wicket

From Dev

passing parameters to wicket panel

From Dev

Update one Wicket Panel from clicking an item in another Wicket Panel

From Dev

Wicket: Submit Form in a Panel from another Panel

From Dev

Wicket: Submit Form in a Panel from another Panel

From Dev

Wicket: add TextField / Panel dynamically

From Dev

Apache-Wicket renders tag <wicket:panel> in page body

From Dev

wicket refresh listView in different panel using ajax

From Dev

Fragment inside a fragment with ViewPager

From Dev

getSupportFragmentManager() inside a fragment inside a fragment

From Dev

Panel floating inside div

From Dev

Bootstrap columns inside panel

From Dev

dygraph inside an absolute panel

From Dev

How to scroll inside a panel?

From Dev

Android adding Fragment inside Fragment

From Dev

Changing fragment inside another fragment

From Dev

Android - Fragment inside a Fragment inside a ViewPager problems

From Dev

open a form in a panel from a form inside that panel

From Dev

Panel inside panel in Bootstrap not creating rounded corners

From Dev

Wicket: addOrReplace() inside Form's onSubmit()

From Dev

Apache Wicket variable link text inside table

From Dev

Wicket: Two AjaxButtons inside separate forms issue

From Dev

Wicket: addOrReplace() inside Form's onSubmit()

From Dev

Android TabLayout inside Fragment

From Dev

Button will not work inside Fragment

From Dev

Using findViewById inside a Fragment

From Dev

getLayoutInflater() inside a Fragment

From Dev

ViewPager inside Fragment