Skip to content

Commit

Permalink
GGW-369: Structures section styling
Browse files Browse the repository at this point in the history
  • Loading branch information
brianbrix committed Nov 7, 2024
1 parent 82f28d0 commit 26c05ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
<div wicket:id="resourcePanel">
<form wicket:id="form">
<table width="40%">

<tr>
<td colspan="2">
<div style="white-space: nowrap;" >
<span class="upfile" wicket:id="file" />
</div>
<button wicket:id="ajaxSubmit" >Import Structures</button>
</td>
</tr>
<tr>
<td colspan="2">
<button wicket:id="ajaxSubmit" >Import Structures</button>
<div style="white-space: nowrap;" >
<span class="upfile" wicket:id="file" />
</div>
</td>
</tr>

</table>
</form>
</div>
<br><br>
<br>
</td>
<td colspan="3">
<a wicket:id="downloadLink" style="display:none;">Download</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,72 +335,6 @@ public void onClick(AjaxRequestTarget target) {
add(addbutton);


// final FileUploadField fileUploadField = new FileUploadField("fileUpload");
// fileUploadField.setOutputMarkupId(true);
//
// final Form<?> form = new Form<Void>("form")
// {
// private static final long serialVersionUID = 1L;
// @Override
// protected void onSubmit() {
// FileUpload upload = fileUploadField.getFileUpload();
// if (upload == null) {
// logger.info("No file uploaded");
// } else {
// logger.info("File-Name: " + upload.getClientFileName() + " File-Size: " +
// Bytes.bytes(upload.getSize()));
// try {
// XSSFWorkbook workbook = new XSSFWorkbook(upload.getInputStream());
// XSSFSheet sheet = workbook.getSheetAt(0);
// Iterator<Row> rowIterator = sheet.iterator();
// rowIterator.next();
//
// while (rowIterator.hasNext()) {
// XSSFRow row = (XSSFRow) rowIterator.next();
// String title = getStringValueFromCell(row.getCell(0));
// String description = getStringValueFromCell(row.getCell(1));
// String latitude = getStringValueFromCell(row.getCell(2));
// String longitude = getStringValueFromCell(row.getCell(3));
//
// AmpStructure stru = new AmpStructure();
// stru.setTitle(title);
// stru.setDescription(description);
// stru.setLatitude(latitude);
// stru.setLongitude(longitude);
// list.addItem(stru);
// list.goToLastPage();
// }
//
//
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// }
// }
//
// };
// form.setMultiPart(true);
// form.setMaxSize(Bytes.megabytes(10));
// form.add(fileUploadField);
//
//
// Button importStructures = new Button("importStructures");
//// importStructures.add(new AttributeModifier("disabled", "true"));
// importStructures.setOutputMarkupId(true);
// form.add(importStructures);
// fileUploadField.add(new AjaxFormComponentUpdatingBehavior("change") {
// private static final long serialVersionUID = 1L;
//
// @Override
// protected void onUpdate(AjaxRequestTarget target) {
// importStructures.setEnabled(true);
// importStructures.add(new AttributeModifier("disabled", (String) null)); // Enable the button
// target.add(importStructures);
//
// }
// });
//
// add(form);

final Model<FileItem> fileItemModel = new Model<FileItem>();
FileUploadPanel fileUpload = new FileUploadPanel("file",String.valueOf(am.getObject().getAmpActivityId()), fileItemModel);
Expand Down Expand Up @@ -449,27 +383,16 @@ protected void onSubmit() {


WebMarkupContainer rc = new WebMarkupContainer("resourcePanel");
// rc.add(new AttributeModifier("id", getToggleId()));
rc.add(form);
// rc.add(name);
rc.add(fileUpload);
rc.setOutputMarkupId(true);
add(rc);


form.add(fileUpload);
Button submit = new Button("ajaxSubmit");
submit.add(new AttributeModifier("class", new Model("addStructure button_green_btm")));

// AmpButtonField submit = new AmpButtonField("ajaxSubmit", "Import Structures", true){
// @Override
// protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
// logger.info("Submitting form");
// target.add(list);
//
//
//
// }
// };

form.add(submit);
ResourceReference resourceReference = new ResourceReference("exportData-"+ System.currentTimeMillis()) {
Expand Down Expand Up @@ -512,7 +435,7 @@ public void onClick(AjaxRequestTarget target) {
};
add(exportStructures);

exportStructures.getButton().add(new AttributeModifier("class", new Model("exportStructures button_blue_btm")));
exportStructures.getButton().add(new AttributeModifier("class", new Model("addStructure button_blue_btm")));
add(exportStructures);


Expand Down

0 comments on commit 26c05ba

Please sign in to comment.