VerticalPanel layout = new VerticalPanel();
layout.setStyleName("window-content");
layout.add(new HTML("<h2>Connection Definition Step1/2</h2>"));
final Form<ConnectionDefinition> form = new Form(ConnectionDefinition.class);
TextBoxItem jndiName = new JndiNameItem("jndiName", "JNDI Name");
TextBoxItem classItem = new TextBoxItem("connectionClass", "Connection Class");
form.setFields(jndiName, classItem);
final FormHelpPanel helpPanel = new FormHelpPanel(
new FormHelpPanel.AddressCallback() {
@Override
public ModelNode getAddress() {
ModelNode address = Baseadress.get();
address.add("subsystem", "resource-adapters");
address.add("resource-adapter", "*");
address.add("connection-definitions", "*");
return address;
}
}, form
);
layout.add(helpPanel.asWidget());
layout.add(form.asWidget());
DialogueOptions options = new DialogueOptions(
// save
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
FormValidation validation = form.validate();
if(!validation.hasErrors())
{
ConnectionDefinition connectionDef = form.getUpdatedEntity();
connectionDef.setApplication(true); // JBPAPP-9977: reasonable default
parent.onCompleteStep1(connectionDef);
}
}
},