11-21-2016 01:50 AM
Hi,
i have followed this url (Creating Aikau Site Pages for Share | Alfresco Developer Blog ) to create Aikau Site Pages for Share (advanced search). In share-confg-custom.xml file , i used "hdp/ws/components/advanced-search#scope=all_sites&searchTerm="
finally i can see button on header.
Problem is when i click on button i can not set keyword from preference and load result.
if i use following topic with parameter, it is properly update URL with keyword and load same data twice.
this.alfPublish("ALF_NAVIGATE_TO_PAGE", {
url: ioQuery.objectToQuery(currHash),
type: "HASH"
}, true);
how to avoid this issue?
Regards
janaka
11-24-2016 01:49 AM
Hi,
Instead of use share-config-custom.xml to create custom button which is working with parameter, on HEADER TITLE , i have used controller JS to setup custom aikau button widget with existing HEADER TITLE .
Reference : Customizing the Share Header Menu 1 | Alfresco Developer Blog
var titleMenu = widgetUtils.findObject(model.jsonModel, "id", "HEADER_TITLE_MENU");
var searchManagerUrl = "hdp/ws/components/com/search#scope=all_sites&searchTerm="+keyword;
if (page.url.templateArgs.site)
{
searchManagerUrl = "site/" + page.url.templateArgs.site + "/" + searchManagerUrl;
}
var searchItem = {
id: "SEARCH_CONFIG_PAGE_LINK",
name: "alfresco/menus/AlfMenuBarItem",
config: {
label: msg.get("com-search-config.label"),
title: msg.get("com-search.config.link"),
targetUrl: searchManagerUrl
}
};
titleMenu.config.widgets.splice(0,0,searchItem);
Regards
janaka
11-21-2016 09:42 AM
i override allWidgetsProcessed() of SingleTextFeildForm and publish following topic (ALF_NAVIGATE_TO_PAGE.). but i can see same result twice.
var currHash = hashUtils.getHash();
currHash.searchTerm = keyword;
this.alfPublish("ALF_NAVIGATE_TO_PAGE", {
url: ioQuery.objectToQuery(currHash),
type: "HASH"
}, true);
11-21-2016 09:45 AM
OK... why are you overriding the allWidgetsProcessed function of SingleTextField form to do that?
11-21-2016 10:03 AM
this function is used to check the initial state of the form. then i use value of search field to assign into HASH, because search field widget is loaded first.
11-21-2016 10:27 AM
OK... so then you must not be publishing a value for the hash to be set... rather than publishing with a type of "PAGE_RELATIVE", why not use a type of "HASH" instead and then the value of either an object with key/value pairs or a string.
11-24-2016 01:49 AM
Hi,
Instead of use share-config-custom.xml to create custom button which is working with parameter, on HEADER TITLE , i have used controller JS to setup custom aikau button widget with existing HEADER TITLE .
Reference : Customizing the Share Header Menu 1 | Alfresco Developer Blog
var titleMenu = widgetUtils.findObject(model.jsonModel, "id", "HEADER_TITLE_MENU");
var searchManagerUrl = "hdp/ws/components/com/search#scope=all_sites&searchTerm="+keyword;
if (page.url.templateArgs.site)
{
searchManagerUrl = "site/" + page.url.templateArgs.site + "/" + searchManagerUrl;
}
var searchItem = {
id: "SEARCH_CONFIG_PAGE_LINK",
name: "alfresco/menus/AlfMenuBarItem",
config: {
label: msg.get("com-search-config.label"),
title: msg.get("com-search.config.link"),
targetUrl: searchManagerUrl
}
};
titleMenu.config.widgets.splice(0,0,searchItem);
Regards
janaka
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.