Custom Query Builders

PDF Print E-mail

Lianja App Builder provides functionality that allows you to build your own custom search and/or query builders.

The section header now has a "Search" icon and a "Custom search delegate" (configurable in the attributes dialog).

This provides the ability to popup a BROWSE grid, select an item and refresh the section on the specified record. The delegate could show a complete query builder or whatever else you need in your UI.

Here is an example of what you can do when the "Search" icon is clicked.

The code in the custom search delegate is simply this but it could be a modal "form" built out of the Lianja Application Framework components. Obviously this can be written in any of the supported scripting languages. This example is written in Recital/Visual FoxPro.

////////////////////////////////////////////////////////////////
// Event delegate for 'customsearch' event
proc Customers_section1_customsearch()
	m_recno = recno()
	m_select = select()
	select customers
	browse caption "Customers" noedit ;
		fields companyname:h="Company Name" size 400,400 title "Select a Customer"
        select m_select
	if _result != 0
		Lianja.getElementByID("Customers.section1").goto(_result)
 		return
	endif
	goto m_recno
endproc

Enjoy.