Changeset 5135
- Timestamp:
- 05/06/14 07:57:42 (10 years ago)
- Location:
- vlo/trunk/vlo-web-app/src/main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/TopLinksPanel.html
r5033 r5135 24 24 <body> 25 25 <wicket:panel> 26 <wicket:enclosure child="linkrequest"> 27 <a wicket:id="linkrequest" id="permalink" href="" title="Get a permanent link to this page"><span>Permalink</span></a> 26 <wicket:enclosure child="linkRequest"> 27 <form id="permalink" wicket:id="linkRequest"> 28 <input wicket:id="linkRequestButton" type="submit" title="Get a permanent link to this page" value="Permalink" /> 29 </form> 28 30 <input wicket:id="linkfield" type="text" id="permalinkfield"></input> 29 31 | -
vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/TopLinksPanel.java
r4987 r5135 23 23 import eu.clarin.cmdi.vlo.service.PageParametersConverter; 24 24 import org.apache.solr.common.SolrDocument; 25 import org.apache.wicket.Component; 25 26 import org.apache.wicket.Session; 26 27 import org.apache.wicket.ajax.AjaxRequestTarget; 28 import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton; 27 29 import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxFallbackLink; 30 import org.apache.wicket.markup.html.form.Form; 28 31 import org.apache.wicket.markup.html.form.TextField; 29 32 import org.apache.wicket.markup.html.link.ExternalLink; … … 55 58 public class TopLinksPanel extends GenericPanel<QueryFacetsSelection> { 56 59 57 @SpringBean(name ="queryParametersConverter")60 @SpringBean(name = "queryParametersConverter") 58 61 private PageParametersConverter<QueryFacetsSelection> paramsConverter; 59 62 @SpringBean … … 80 83 81 84 // action to link to request the permalink 82 add(createPermaLink("link request", linkModel));85 add(createPermaLink("linkRequest")); 83 86 // field that holds the actual link 84 87 add(createLinkField("linkfield", linkModel)); … … 99 102 } 100 103 101 private Link<String> createPermaLink(String id, final IModel<String> linkModel) { 102 return new IndicatingAjaxFallbackLink<String>(id, linkModel) { 104 private Component createPermaLink(String id) { 105 // Create a form with a button to toggle permalink rather than an action link 106 // to prevent people from confusing the link generated by wicket with 107 // the actual permalink generated by the application 108 final Form form = new Form(id) { 103 109 104 110 @Override 105 public void onClick(AjaxRequestTarget target) { 111 protected void onConfigure() { 112 super.onConfigure(); 113 setVisible(TopLinksPanel.this.getModel() != null); 114 } 115 }; 116 117 form.add(new AjaxFallbackButton("linkRequestButton", form) { 118 119 @Override 120 protected void onSubmit(AjaxRequestTarget target, Form<?> form) { 106 121 // toggle 107 122 linkVisibilityModel.setObject(!linkVisibilityModel.getObject()); … … 115 130 } 116 131 117 @Override 118 protected void onConfigure() { 119 super.onConfigure(); 120 setVisible(TopLinksPanel.this.getModel() != null); 121 } 132 }); 122 133 123 };134 return form; 124 135 } 125 136 -
vlo/trunk/vlo-web-app/src/main/resources/eu/clarin/cmdi/vlo/wicket/pages/vlo-header.css
r5033 r5135 102 102 } 103 103 104 form#permalink { 105 display: inline; 106 } 107 108 form#permalink input { 109 /* permalink submit button should look like link to fit in with other links */ 110 display: inline; 111 border: none; 112 background: none; 113 text-decoration: underline; 114 color: #00f; 115 font-family: inherit; 116 font-size: inherit; 117 padding: 0; 118 cursor: pointer; 119 } 120 104 121 #permalinkfield 105 122 {
Note: See TracChangeset
for help on using the changeset viewer.