Toolbar Tutorial - Search Navigation

Next


In this example, we add some simple search navigation, to browser multiple pages of results.

We also need to modify the search command, to define pages 1,2,3 ... of results. This is done by using the Search() function.

If you now do a search for the keyword: 'html', you can click the next button to display page 2 of results.


Source:

<XML id="toolbar">
<TOOLBAR caption="Toolbar Tutorial">
<control type="toolbar">
<button id="home"

    caption="Download.com: "
    action="http://www.download.com"
    tooltip="Download.com Home Page">

</button>
<dropdown action="Menu(links)"></dropdown>
</control>

<control type="combo" id="query" action="Command(search)" width=120></control>
<control type="toolbar">
<button caption="Search" tooltip="Search Download.com" image="http://www.toolbarbrowser.com/img/magnify.ico" action="Command(search)"></button>
<button caption="Back" tooltip="Search Previous" image="http://www.toolbarbrowser.com/img/back.ico" action="SearchBack()"></button>
<button caption="Next" tooltip="Search Next" image="http://www.toolbarbrowser.com/img/next.ico" action="SearchNext()"></button>

</control>

<MENUDEFINITIONS>
    <menu id="links">
    <option caption="Download.com" action="http://www.download.com"></option>
    <separator></separator>
    <option caption="Software" action="http://www.download.com/2001-20_4-0.html?tag=tab"></option>
    <option caption="Music" action="http://music.download.com/2001-1_32-0.html?tag=tab"></option>
    <option caption="Games" action="http://www.download.com/2001-2012_4-0.html?tag=tab" image="http://www.toolbarbrowser.com/img/smiley.ico"></option>
    </menu>

</MENUDEFINITIONS>

<COMMANDS>
    <command id="search" action="Search('http://www.download.com/3120-20-0.html?qt=%QUERY%&tg=dl-2001&search.x=17&search.y=2',
    'http://www.download.com/3120-2001-0-2-0.html?qt=%_QUERY%&ca=2001&excl=10304226&excl=10308849&excl=10265867&excl=10283988&excl=10291260',
    'http://www.download.com/3120-2001-0-3-0.html?qt=%_QUERY%&ca=2001&excl=10304226&excl=10308849&excl=10265867&excl=10283988&excl=10291260')"

    ></command>

</COMMANDS>

</TOOLBAR>
</XML>





Remarks:

  • In the search command, we have replaced the URL with the Search() function. This enables us to define multiple search pages. This is needed for the NEXT and BACK buttons. Each parameter of the Search() function is a URL to a page of results. In this example we have defined 3 URLs for search result pages 1-3.






























>