Pattern 2: Search-and-Results Across Two Pages

Previous Next

In this design pattern, a first page offers a search facility containing a Search block for entering search conditions. A second page offers search results. Navigation between the pages occurs when the user clicks Search.

To spread search and result functionality across two pages:

1.In the Web Designer catalog, identify the (default) info page corresponding with the main table, for example, the Tours page.
2.Create two new subclasses of this info page and rename them appropriately, for example SearchTours and ResultTours.
3.In the SearchTours page, identify the SearchButton in the SearchGroup. The easiest way to do this is to click the button in the page preview and then expand nodes in the objects tree on the right.
4.For the onclick event listener, leave the executeQuery() action intact, and insert a new Action object of type CallClientScript.
5.Make sure the new Action is executed AFTER the executeQuery() action by setting its Seqno property to a higher number.
6.For the new Action, set the Script property to:

$.udb.navigateTo( 'ResultsTours' )

 

When the user lands on the ResultsTours, the data displayed will match the search conditions from the previous page. This works only if both pages use the same data source name (here, TOUR) for the data.
7.Remove the ResultGroup and other unwanted functionality from the SearchTours page.
8.Remove the SearchGroup from the ResultsTours page.
9.Optionally, insert a 'Back' or 'New Search' button in the ResultTours page, with a callClientScript action set to:

$.udb.navigateTo( 'SearchTours' )

 

 

See Also

Page and Data Source Constructs