Skip to content

Commit

Permalink
Merge pull request #1055 from support-project/issue1052_fix_search_ke…
Browse files Browse the repository at this point in the history
…yword

Fixed bug that search condition removed when page switching
  • Loading branch information
koda-masaru authored Jul 22, 2018
2 parents 05adb30 + 693984f commit a3eed06
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ public class KnowledgeControlBase extends Control {
private static final String MARKDOWN_SAMPLE = "/org/support/project/knowledge/markdown/sample_markdown.md";

protected String setViewParam() {
List<LabelValue> paramsArray = new ArrayList<>();
paramsArray.add(new LabelValue("offset", getParamWithDefault("offset", "")));
paramsArray.add(new LabelValue("keyword", getParamWithDefault("keyword", "")));
paramsArray.add(new LabelValue("tag", getParamWithDefault("tag", "")));
paramsArray.add(new LabelValue("tagNames", getParamWithDefault("tagNames", "")));
paramsArray.add(new LabelValue("group", getParamWithDefault("group", "")));
paramsArray.add(new LabelValue("groupNames", getParamWithDefault("groupNames", "")));
paramsArray.add(new LabelValue("user", getParamWithDefault("user", "")));
paramsArray.add(new LabelValue("creators", getParamWithDefault("creators", "")));
String[] templates = getParam("template", String[].class);
if (templates != null) {
for (String template : templates) {
paramsArray.add(new LabelValue("template", template));
}
List<LabelValue> paramsArray = new ArrayList<>();
paramsArray.add(new LabelValue("offset", getParamWithDefault("offset", "")));
paramsArray.add(new LabelValue("keyword", getParamWithDefault("keyword", "")));
paramsArray.add(new LabelValue("tag", getParamWithDefault("tag", "")));
paramsArray.add(new LabelValue("tagNames", getParamWithDefault("tagNames", "")));
paramsArray.add(new LabelValue("group", getParamWithDefault("group", "")));
paramsArray.add(new LabelValue("groupNames", getParamWithDefault("groupNames", "")));
paramsArray.add(new LabelValue("user", getParamWithDefault("user", "")));
paramsArray.add(new LabelValue("creators", getParamWithDefault("creators", "")));
String[] templates = getParam("template", String[].class);
if (templates != null) {
for (String template : templates) {
paramsArray.add(new LabelValue("template", template));
}
}
StringBuilder params = new StringBuilder();
boolean append = false;
for (LabelValue labelValue : paramsArray) {
Expand All @@ -56,10 +56,12 @@ protected String setViewParam() {
} else {
params.append('&');
}
params.append(labelValue.getLabel()).append("=").append(labelValue.getValue());
params.append(HtmlUtils.escapeHTML(labelValue.getLabel()))
.append("=")
.append(HtmlUtils.escapeHTML(labelValue.getValue()));
}
}
setAttribute("params", HtmlUtils.escapeHTML(params.toString()));
setAttribute("params", params.toString());
return params.toString();
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/views/open/knowledge/list.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@
<nav>
<ul class="pager">
<li class="previous"><a
href="<%=request.getContextPath()%>/open.knowledge/list/<%=jspUtil.out("previous")%><%=jspUtil.out("params")%>"> <span
aria-hidden="true">&larr;</span><%=jspUtil.label("label.previous")%>
href="<%=request.getContextPath()%>/open.knowledge/list/<%=jspUtil.out("previous")%><%=jspUtil.out("params")%>">
<span aria-hidden="true">&larr;</span><%=jspUtil.label("label.previous")%>
</a></li>
<li class="next"><a
href="<%=request.getContextPath()%>/open.knowledge/list/<%=jspUtil.out("next")%><%=jspUtil.out("params")%>"> <%=jspUtil.label("label.next")%>
<span aria-hidden="true">&rarr;</span>
href="<%=request.getContextPath()%>/open.knowledge/list/<%=jspUtil.out("next")%><%=jspUtil.out("params")%>">
<%=jspUtil.label("label.next")%> <span aria-hidden="true">&rarr;</span>
</a></li>
</ul>
</nav>
Expand Down

0 comments on commit a3eed06

Please sign in to comment.