Skip to content

Commit

Permalink
fixed searchController and ui (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jan 9, 2025
1 parent 24031d0 commit 69341d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,17 @@
value="#{message['worklist.sortorder']}: " />
<h:selectOneMenu style="background:#fff;"
value="#{searchController.searchFilter.item['sortorder']}">
<f:selectItem itemValue=""
<f:selectItem itemValue="0"
itemLabel="#{message['worklist.sortorder_relevance']}" />
<f:selectItem itemValue="3"
itemLabel="#{message['worklist.sortorder_lastupdate']}" />

<f:selectItem itemValue="1"
itemLabel="#{message['worklist.sortorder_newest']}" />
<f:selectItem itemValue="2"
itemLabel="#{message['worklist.sortorder_oldest']}" />


<f:ajax event="change" render="@form"
listener="#{searchController.refreshSearch}"
listener="#{viewHandler.init()}"
onevent="imixsOfficeMain.layoutAjaxEvent" />
</h:selectOneMenu>
<span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,18 @@ public ItemCollection getSpace() {
public void reset() {
defaultQuery = null;
title = null;

String processref = "";
if (searchFilter != null) {
// restore the old processref
processref = searchFilter.getItemValueString("processref");
}

searchFilter = new ItemCollection();
searchFilter.replaceItemValue("type", "workitem");
// set default user mode
searchFilter.replaceItemValue("usermode", "owner");
searchFilter.replaceItemValue("processref", processref);
this.setPageIndex(0);
super.reset();
}
Expand Down Expand Up @@ -329,6 +337,7 @@ public String resetSearch() {
*/
public String refreshSearch() {
String phrase = searchFilter.getItemValueString("phrase");
String processref = searchFilter.getItemValueString("processref");

try {
phrase = URLEncoder.encode(phrase, "UTF-8");
Expand All @@ -337,6 +346,9 @@ public String refreshSearch() {
e.printStackTrace();
}
String action = "/pages/workitems/worklist.xhtml?faces-redirect=true&phrase=" + phrase;
if (!processref.isEmpty()) {
action = action + "&processref=" + processref;
}
this.setPageIndex(0);
return action;
}
Expand Down

0 comments on commit 69341d9

Please sign in to comment.