Skip to content
chrisco484 edited this page Aug 9, 2011 · 2 revisions

ModelX Project

A lightweight extension to Wicket's ModalWindow capabilities that comes with standardized MessageBox class and allows easy definition of Modal dialog box classes, similar in nature to desktop application development in frameworks like MFC, .net, OWL, Swing etc.,

  • ModalWindow is genericized as ModalContentWindow and is automatically managed. Definition of a new Modal Form needs only to extend a single class ModalContentForm.
  • Generic ModalWindow management - open from anywhere in your application without explicitly defining the ModalWindow tag markup in a component that might need it.
  • MessageBox feature
  • IWindowCloseListener - optional listener on any ModalContentPanel close event.
  • ModalResult - a desktop framework concept. Allows a IWindowCloseListener to query the button the user pressed to close a ModalWindow.

Here is a live demonstration:

Live Demo

ModalX Home page at Visual Classworks:

ModalX Home

Maven Artifacts

  • modalx
  • modalx-examples

Documentation

ModalX Class Diagram

This Visual Classworks/Javelin class diagram shows the core classes and how they relate to each other. The base class ModalContentPanel implements the behavior necessary to display itself inside a generic ModalWindow (ModelContentWindow) instance which means ModalWindow has been genericized and can be effectively ignored when defining a new ModalFormPanel class.

ModalX Class Diagram

Maven Stable

<dependency>
    <groupId>org.wicketstuff</groupId>
    <artifactId>modalx</artifactId>
    <version>1.4.17</version>
</dependency>

Maven Development

<dependency>
    <groupId>org.wicketstuff</groupId>
    <artifactId>modalx</artifactId>
    <version>1.4-SNAPSHOT</version>
</dependency>

<repository>
	<id>wicketstuff-core-snapshots</id>
	<url>ttps://oss.sonatype.org/content/repositories/snapshots</url>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>		
</repository>

Java

Definition of a form class:

    public class TestForm extends ModalFormPanel {
        public TestForm(ModalContentWindow iModalContentWindow, 
            IWindowCloseListener iWindowCloseListener, Person iPerson) {
            super(iModalContentWindow, iWindowCloseListener);

            person = iPerson;
            setTitle("Personal Details");
        }

        public void addFormComponents() {
            form.add(new RequiredTextField("firstName",
                 new PropertyModel(person, "firstName")).setLabel(new Model("First Name")));
            form.add(new RequiredTextField("lastName",
                 new PropertyModel(person, "lastName")).setLabel(new Model("Last Name")));
            etc.,
        }
    }

Opening a form:

    TestForm testForm = new TestForm(allocateModalWindow(), null, person);

    testForm.show(target);

Project Maintainers

Chris Colman

Source Code

core-1.4.x Branch

Path is: /jdk-1.5-parent/modalx-parent

master Branch

Path is: /jdk-1.5-parent/modalx-parent

Clone this wiki locally