JHeadstart recipe – non-databound search-criteria

Lucas Jellema 1

From today’s customer assignment I extract the following recipe – for BC4J, JSP and Struts.: Suppose that on the FindPage of our JHeadstart generated JSP application we would like to add one or more search-criteria that are not directly bound to ViewObject attributes. For example in the context of the ALS application: the FindBookPage contains a field labeled AuthorFirstName. Here, the user may enter the firstname of an author. The application should now only return books in the result set that have at least one contributing author whose firstname matches the one entered by the end-user. The ViewObject underlying the Bookpages does not contains Authorships and Author information. A direct query on this ViewObject can not make use of the AuthorFirstName property. Of course, when no value is entered in this field, the query should not look for authors at all!

When a value for AuthorFirstName is provided, an additional piece of where-clause should be activated that looks from the ALS_BOOKS table via the ALS_AUTHORSHIPS table in the ALS_AUTHORS table.Now how are we going to do that?

1. Add additional search criteria to the JSP for the FindPage
2. Add Form Bean properties to the FindFormBean for these new fields
3. Create your own ApplicationModuleImpl (extend JhsApplicationModuleImpl) with a new and overloaded getRestrictedDataObjectSet method
4. Implement in the specific DataObjectHandlerImpl the getRestrictedDataObjectSet method that catches and processes additional, non VO-bound search criteria.

The recipe is found here, describing these steps in detail: Recipe for non-ViewObject Attribute bound search criteria.

See here for the entire AMIS JHeadstart Cookbook.

One thought on “JHeadstart recipe – non-databound search-criteria

  1. Hello,
    Can we please take the dependency on having a J:\ drive out ? It is
    difficult to install JHeadStart due to this.

Comments are closed.

Next Post

Google Desktop Search - no more agonizing searches for lost documents

This weekend I installed the Google Desktop Search tool. It is currently in Beta, it is free, about 400K in size and can be downloaded from http://desktop.google.com/. After you have downloaded and installed (within a minute) it starts scanning the files on your harddisk: Word, Excel and Powerpoint, HTML, text […]