How do I use a form to filter / search a table?

cheesegrits

Support Gopher
A common requirement in Fabrik apps is to create a form which acts as a search filter for a table.

Lets say you have a table of Widgets, which have a 'description' and a 'name' element. You want to set up a form which will search the table on those two elements.

Create a new group (widget_search).

Create two elements in that group which have the same names as the elements in Widgets you are searching on ('name' and 'description'). Usually the easiest way to do this is to copy the original element, edit it, change the name back to the original name (it will have called itself copy_of_foo), and change the group to your new search group.

Create a new form (Widget Search). Include the new widget_search group. Don't enable email receipts, do not record in database. Set the Jump Page to the URL of the Widget table page (if in doubt just copy and paste it from your browser). Link the the form to your desired menu.

And that's it. When the Widget Search form is submitted, it will jump to the Widget Table page, and filter the table according to the values on the Widget Search form.

NOTE - your Widget Table page should probably not have any search features (element filters, advanced search) enabled, as these will tend to override what you are sending it from the search form.

-- hugh
 
On a related issue, can we make the elements of a search form be the dropdown choices of all the types entered in the table to be searched through?, like the way a filter behaves? That much less work for the searcher?
Thanks
Shiv
 
It would be great if i could make an advanced filtering trough the form. For example selecting all records that have a a certain value range for a specific field (i.e. price < 100). Is there the possibility to make a query of this type by this method?
 
Filtering of forms...

I think the solution outilined is very very clumsy... I just spent the whole afternoon battling with it. The first 50 elements are filtered but as soon as you go to next, no more filters....

It would be great to be able to apply permanent filters to a table so that the user only sees a part of it. I could have then two menu items one with the filter and one without the filter...

As it stands now each time you want to filter a table you have to make a copy of it with all the elements being duplicated... a real mess...
 
We are working on improving some of this stuff in 2.0.

Fabrik isn't a universal, do everything exactly how you want it solution. My usual analogy is that it's a Swiss Army Knife. As such, it does a lot of things pretty damn well, but has limitations. In this case, the little tweezer tool need some redesign. :)

BTW, can you report that '50 elements and no more filters' as a bug in the appropriate forum?

-- hugh
 
Yes indeed... the swiss knife analogy is appropriate (and sometimes you cut your fingers). At present there is nothing beating Fabrik...

Still think that basic database operations like record navigation and easy filtering of table should be high on the list. I wil report the bug...
 
Filtering of tables

Hi

I found a workaround which is... using DBQ

Here is an example of the combination :

Fabrik to use the nice filters ...

And when I want to show specific view of my tables use DBQ :

In fact using DBQ, I am able to point towards the forms designed under fabriks (click on link in first column) ...
 
Is this the same procedure you would use in version 2? I do not see the Jump Page field that is referenced.
 
Redirect condition code help

Hugh,

What code would I put into the Redirect form plugin's condition that would check if the value entered into a single field exists in the table, and if so, process the redirect? Please furnish the full code to paste into the field, as that is where I'm stuck.

Here is what I currently have:

Code:
return '{fabrik_vendorlist___vendor_code}' = 1

That's everything, but I must be missing something because even with a value entered that definitely exists in the database, it just hangs.

Thanks,
railer
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top