-
Notifications
You must be signed in to change notification settings - Fork 298
ModalX
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:
ModalX Home page at Visual Classworks:
- modalx
- modalx-examples
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.
<dependency>
<groupId>org.wicketstuff</groupId>
<artifactId>modalx</artifactId>
<version>1.4.17</version>
</dependency>
<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>
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);
Chris Colman
Path is: /jdk-1.5-parent/modalx-parent
Path is: /jdk-1.5-parent/modalx-parent