I'm working on a custom widget that uses tagedContent.List to search on a tag and display the results in a Pager. Here are the basics:
setquery.vm
#registerEndOfPageHtml() <script type="text/javascript"> jQuery(function(j){ j('#$core_v2_widget.WrapperElementId #custom-search-btn').on('click',function(e){ e.preventDefault(); console.log('here'); var tagSearchStr = ''; var select = j('#$core_v2_widget.WrapperElementId .custom-search-tag-select'); var keyword = j('#$core_v2_widget.WrapperElementId .custom-search-keyword'); if(select.val() !== '0') { //keyword.val(''); tagSearchStr = select.val() } else if(keyword.val() !== '') { tagSearchStr = keyword.val(); } if(tagSearchStr !== '') { console.log('searching: ' + tagSearchStr); var hashAdjustment = {}; hashAdjustment['Tags'] = tagSearchStr; j.telligent.evolution.url.hashData(hashAdjustment, { overrideCurrent: true, prefix: '$core_v2_encoding.JavascriptEncode($core_v2_ui.PageIndexQueryStringKey)' }); } }) }) </script> #end #set ($query = "%{Tags='test',PageSize=$pageSize,PageIndex=$pageIndex,ApplicationTypeIds=$applicationTypeId}")
list.vm
$core_v2_widget.ExecuteFile('setquery.vm') #set ($response = $core_v2_taggedContent.List($query)) #foreach($item in $response) <div class="xs-text-6">$item.Content.HtmlName("web")</div> #end ## Paging #set ($pagerOptions = "%{ PagedContentFile = 'list.vm', LoadingIndicator = 'true', LoadOnAnyHashChange = 'true' }") $core_v2_ui.Pager($response.PageIndex, $response.pageSize, $response.TotalCount, $pagerOptions)
The initial page load works great (I'm getting expected results for that default tag "test"). I have an option to change the tag it's searching on and when that's triggered in the JS in the setquery.vm file, the result box flashes like it's reloading things (and I get the hash added to the url), but the results don't actually change. What am I missing?
removing custom class names
[edited by: wkopala at 7:31 PM (GMT 0) on Thu, Aug 5 2021]