How to pass values to embedded widget

Feddy
Kilo Sage

Hi Team , 

I have cloned OOB widget "Faceted Search" and modified to embed clone of "Search page" widget.
Search page widget is not getting updated when I search something and need to reload the form again to see the data.


I am using below line to call the widget
              <sp-widget widget="data.widget"></sp-widget>            
            

and below is the server script of the embedded widget

find_real_file.png

 

the data.q is taking only for the first time , but next time it doesn't work and I need to refresh it.

Any help on this would be much appreciated.

Thanks, 
Feddy

2 REPLIES 2

palanikumar
Mega Sage

Hi,

Can you please give more details? Do you want to refresh it after clicking button? if yes share the code and expected ouput

Thank you,
Palani

Please refer images below,

When I search a keyword from homepage it takes us to search page , you can notice that the typeahead widget has outlook key word and the URL also updated with q=outlook, and the quickhelp displays result for key outlook.
find_real_file.png

 

when I enter other key word (ex : Password) in typeahead widget , the URL gets updated and rest of the tab like(knowledge, catalog item) displays respective results whereas the quickhelp tab still displays old resutls.


I have embedded our custom search page widget to clone of "Faceted widget" using below way

 

1. custom "Faceted Search" widget
 HTML : 

<div ng-if="c.data.showQuickHelp">
 <sp-widget widget="data.widget"></sp-widget>

<div>

 

server script : 
data.widget = $sp.getWidget('xxx_search_page');

 

2. custom "Search Page"(xxx_search_page) widget

 

server script : 
data.q = encodeURIComponent($sp.getParameter('q'));


I would like to take key word entered in the typeahead widget or from the URL and pass it to data.q ..



Thanks!