Changeset 4250
- Timestamp:
- 01/10/14 11:25:24 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.java
r4249 r4250 503 503 } 504 504 505 private Label completeCmdiLabel = null; 506 505 507 /** 506 508 * Add complete CMDI view … … 509 511 */ 510 512 private void addCompleteCmdiView(final SolrDocument solrDocument) { 511 513 // create a container for the complete CMDI view and a toggle link (this is required for proper AJAX updates) 512 514 final MarkupContainer completeCmdiContainer = new WebMarkupContainer("completeCmdiContainer"); 513 515 completeCmdiContainer.setOutputMarkupId(true); 514 516 add(completeCmdiContainer); 517 518 // Add a toggle link that provides lazy execution of CMDI transformation 515 519 Link toggleLink = new IndicatingAjaxFallbackLink("toggleCmdiView") { 516 520 … … 518 522 public void onClick(AjaxRequestTarget target) { 519 523 if (completeCmdiLabel == null) { 524 // first click: perform transformation 520 525 createCompleteCmdiView(solrDocument); 521 526 completeCmdiContainer.addOrReplace(completeCmdiLabel); 522 527 } else { 528 // subsequent click: toggle visibility of transformation output 523 529 completeCmdiLabel.setVisible(!completeCmdiLabel.isVisible()); 524 530 } … … 526 532 } 527 533 }; 534 // add a label to the toggle link that represents the visibility state of the transformation output 528 535 final Label toggleLabel = new Label("toggleLabel", new AbstractReadOnlyModel<String>() { 529 536 … … 539 546 toggleLink.add(toggleLabel); 540 547 completeCmdiContainer.add(toggleLink); 541 completeCmdiContainer.add(new WebMarkupContainer("completeCmdi")); 548 549 // add a placeholder for the transformation 550 final WebMarkupContainer completeCmdiPlaceholder = new WebMarkupContainer("completeCmdi"); 551 completeCmdiPlaceholder.setVisible(false); 552 completeCmdiContainer.add(completeCmdiPlaceholder); 542 553 } 543 554 … … 570 581 completeCmdiLabel.setEscapeModelStrings(false); 571 582 } 572 573 private Label completeCmdiLabel = null;574 583 }
Note: See TracChangeset
for help on using the changeset viewer.