@Override public void onSubmit(AjaxRequestTarget target, Form form) { File file = null; textField.processInput(); String input = textField.getConvertedInput(); if (input != null && !input.equals("")) { file = new File(input); } GeoServerFileChooser chooser = new GeoServerFileChooser(modal.getContentId(), new Model(file)) { protected void fileClicked( File file, AjaxRequestTarget target) { // clear the raw input of the field won't show the new model // value textField.clearInput(); textField.setModelObject(file.getAbsolutePath()); target.add(textField); dialog.close(target); }; }; chooser.setFileTableHeight(null); modal.setContent(chooser); modal.setTitle(windowTitle); modal.show(target); } };
@Override public void onSubmit(AjaxRequestTarget target, Form form) { File file = null; textField.processInput(); String input = (String) textField.getConvertedInput(); if (input != null && !input.equals("")) { file = new File(input); } GeoServerFileChooser chooser = new GeoServerFileChooser(dialog.getContentId(), new Model(file)) { protected void fileClicked(File file, AjaxRequestTarget target) { // clear the raw input of the field won't show the new model value textField.clearInput(); textField.setModelObject(file.getAbsolutePath()); target.addComponent(textField); dialog.close(target); }; }; chooser.setFileTableHeight(null); chooser.setFilter(fileFilter); dialog.setContent(chooser); dialog.setTitle(windowTitle); dialog.show(target); }
@Override public void onSubmit(AjaxRequestTarget target, Form<?> form) { File file = null; textField.processInput(); String input = textField.getConvertedInput(); if (input != null && !input.equals("")) { file = new File(input); } GeoServerFileChooser chooser = new GeoServerFileChooser( dialog.getContentId(), new Model<File>(file)) { private static final long serialVersionUID = -7096642192491726498L; protected void fileClicked( File file, AjaxRequestTarget target) { // clear the raw input of the field won't show the new model // value textField.clearInput(); textField.setModelObject(file.getAbsolutePath()); target.add(textField); dialog.close(target); }; }; chooser.setFileTableHeight(null); chooser.setFilter(fileFilter); dialog.setContent(chooser); dialog.setTitle(windowTitle); dialog.show(target); } };