Tuesday, May 25, 2010

Master View Search Form .Display Only Results in Detail View Objects

Hi,
There is a very easy way to  keep your Search Form in find mode all the time.
Consider this:
Lets say that we have a Master View Object (e.g. Employees) and a Detail View Object( e.g Departments).
We want to Use the Master as a Search Form and the Detail as a result table.

The structure of our page is the following:
1) Master as a search form(always entering in find mode.)
2) Detail as a readOnly detail table.

We want our page to show something like this:


and we want to show like this:


a) First of All we frag and drop the Master view object as a search form into our page.

b) Second we remove the find button but we keep the operation in the pageDef.

c) In the pageDef, we create an invokeAction in the executables. This invokeAction will invoke the Find operation. The refresh condition will be "prepareModel" We want this because it will be invoked when initializing the iterators.

d) In the page, we set the "Execute" button to partialSubmit=true

e) In the read Only detail table, we set the following partialTriggers:
         the execute button, and the searchForm. We do this because we do want  the Detail show data at the first place. And, we want it to be refreshed after the button is shown.

Donwside:
If we will execute with empty criteria or with criteria that will fetche more than one row in the Master.. the detail will show rows only for the first fetched Master row.

download sample application.

Regards.

1 comment:

LinkWithin

Related Posts Plugin for WordPress, Blogger...