Last change
on this file since 4220 was
4220,
checked in by twagoo, 10 years ago
|
Merged twagoo branch of to-wicket-1.6 back to original, removed this branch
|
File size:
1.1 KB
|
Line | |
---|
1 | package eu.clarin.cmdi.vlo.pages; |
---|
2 | |
---|
3 | import eu.clarin.cmdi.vlo.VloPageParameters; |
---|
4 | import org.apache.solr.client.solrj.response.FacetField.Count; |
---|
5 | import org.apache.wicket.markup.html.basic.Label; |
---|
6 | import org.apache.wicket.markup.html.link.BookmarkablePageLink; |
---|
7 | import org.apache.wicket.markup.html.link.Link; |
---|
8 | import org.apache.wicket.model.IModel; |
---|
9 | import org.apache.wicket.request.mapper.parameter.PageParameters; |
---|
10 | |
---|
11 | public class FacetLinkPanel extends BasePanel { |
---|
12 | |
---|
13 | private static final long serialVersionUID = 1L; |
---|
14 | |
---|
15 | public FacetLinkPanel(String id, IModel<Count> model, final SearchPageQuery query) { |
---|
16 | super(id, model); |
---|
17 | |
---|
18 | Count count = model.getObject(); |
---|
19 | SearchPageQuery q = query.getShallowCopy(); |
---|
20 | q.setFilterQuery(count); |
---|
21 | PageParameters param = q.getPageParameters(); |
---|
22 | |
---|
23 | Link<Count> facetLink = new BookmarkablePageLink("facetLink", FacetedSearchPage.class, param); |
---|
24 | facetLink.add(new Label("facetLinkLabel", model.getObject().getName())); |
---|
25 | add(facetLink); |
---|
26 | add(new Label("facetCount", "" + model.getObject().getCount())); |
---|
27 | } |
---|
28 | |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.