}
}));
styleChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
StyleInfo s = (StyleInfo) styleChoice.getModelObject();
mapPanel.update(null,s,target);
updateSLD();
target.addComponent(sldTextArea);
}
});
updateStyles(layer);
form.add(new AjaxButton("save", form) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
//sldTextArea.inputChanged();
//sldTextArea.processInput();
Catalog catalog = ((GeoServerApplication)getApplication()).getCatalog();
StyleInfo style = (StyleInfo) styleChoice.getModelObject();
try {
catalog.getResourcePool().writeStyle(style, new ByteArrayInputStream(sld.getBytes()));
catalog.save(style);