</hbox>\r
</vlayout>\r
<hbox width="100%" pack="center" align="left">\r
- <combobox id="search" hflex="1" focus="true" model="@load(vm.searchHistory)" autodrop="true"\r
- tooltiptext="Gépelje be a keresendő kifejezést és nyomja meg az Enter-t." onSelect="@command('doSearch')" onOK="@command('doSearch')">\r
+ <combobox id="search" hflex="1" focus="true" model="@load(vm.searchHistory)" autodrop="true" buttonVisible="false"\r
+ tooltiptext="Gépelje be a keresendő kifejezést és nyomja meg az Enter-t." onOK="@command('doSearch')">\r
<template name="model">\r
<comboitem label="${each}" />\r
</template>\r
</combobox>\r
- <button hflex="min" image="/img/ic_search_black_18dp.png" onClick="@command('doSearch')" style="width:40px" />\r
+ <button hflex="min" image="/img/ic_search_black_18dp.png" onClick="@command('doSearch')" />\r
+<!-- <spinner inplace="true" value="50" width="50px"/> -->\r
+ <a onClick="@command('clearHistory')" style="font-size: 9px;">előzmények törlése</a>\r
</hbox>\r
</groupbox>\r
<popup id="sortOther">\r
<label style="font:20px Century Gothic; color:#008AC8;" value="@load(each.item.title)" />\r
</hlayout>\r
<html sclass="relevant">\r
+ \r
<![CDATA[ <div style='width: 90%'>${each.relevant}</div> ]]>\r
+ \r
</html>\r
</div>\r
</hlayout>\r
import org.zkoss.zul.Hlayout;\r
import org.zkoss.zul.ListModelList;\r
import org.zkoss.zul.Messagebox;\r
+import org.zkoss.zul.Paging;\r
import org.zkoss.zul.Row;\r
import org.zkoss.zul.Timer;\r
import org.zkoss.zul.Window;\r
public void afterCompose(@ContextParam(ContextType.VIEW) Component view) {\r
Selectors.wireComponents(view, this, false);\r
Selectors.wireEventListeners(view, this);\r
- itemsGrid.getPagingChild().setAutohide(false);\r
+ Paging paging = itemsGrid.getPagingChild();\r
+ paging.setAutohide(false);\r
\r
for (Component child : itemsGrid.getColumns().getChildren()) {\r
Column column = (Column) child;\r
searchResult = new InitializedCachedListModel(mediaID, searchValue, new ArrayList<String>(), orderBy, orderAscending);\r
}\r
\r
+ @Command\r
+ @NotifyChange("searchHistory")\r
+ public void clearHistory() {\r
+ setSearchHistory(new ListModelList<>());\r
+ SessionUtil.putUserSearchHistory(searchHistory);\r
+ }\r
+\r
@Command\r
public void copyMediaIdToClipboard() {\r
String port = (Executions.getCurrent().getServerPort() == 80) ? "" : (":" + Executions.getCurrent().getServerPort());\r
import org.zkoss.zk.ui.Session;\r
import org.zkoss.zk.ui.Sessions;\r
\r
+import com.ibm.nosql.json.api.BasicDBList;\r
import com.ibm.nosql.json.api.BasicDBObject;\r
import com.ibm.nosql.json.api.QueryBuilder;\r
\r
\r
public static List<String> getUserSearchHistory() {\r
BasicDBObject userSettings = getUserSettings();\r
- String[] history = (String[]) userSettings.get(SEARCH_HISTORY);\r
- return (history == null) ? new ArrayList<>() : Arrays.asList(history);\r
+ BasicDBList history = (BasicDBList) userSettings.get(SEARCH_HISTORY);\r
+ return (history == null) ? new ArrayList<>() : Arrays.asList(history.toArray(new String[history.size()]));\r
}\r
\r
static private BasicDBObject getUserSettings() {\r
BasicDBObject result = (BasicDBObject) getAttribute(USER_SETTINGS);\r
if (result == null) {\r
UserPrincipal userPrincipal = getUserPrincipal();\r
- result = (BasicDBObject) NoSQLUtils.collection(USER_SETTINGS).findOne(QueryBuilder.start(USER_NAME).is(userPrincipal.getAccount()));\r
+ result = (BasicDBObject) NoSQLUtils.collection(USER_SETTINGS).findOne(QueryBuilder.start(USER_NAME).is(userPrincipal.getAccount()).get());\r
if (result == null)\r
result = new BasicDBObject(USER_NAME, userPrincipal.getAccount());\r
}\r
\r
public static void putUserSearchHistory(List<String> searchHistory) {\r
BasicDBObject userSettings = getUserSettings();\r
- userSettings.put(SEARCH_HISTORY, searchHistory.toArray(new String[searchHistory.size()]));\r
+ BasicDBList history = new BasicDBList();\r
+ history.addAll(searchHistory);\r
+ userSettings.put(SEARCH_HISTORY, history);\r
putUserSettings();\r
}\r
\r