Searching for form records to edit

joit

Active Member
Hi,

I tried this
{fabrik view=form id=1 usekey=user rowid=62}
(with my own values) exactly as described in the wiki here
http://fabrikar.com/forums/index.php?wiki/content-plugin/#searching-for-form-records-to-edit
with several forms but I had no success.
The most I got was the ok / cancel buttons but I just don't see the element. Is there something else I have to activate for this to work?
Are there any restrictions on forms? It doesn't work for all.

Thanks
Hannes
 
That could be the problem
if I set form edit to public this:
{fabrik view=form id=1 usekey=user_id rowid=[$my->id]}
displays whole form (in the wiki it says it would only show 1 element for editing)

if I set form edit to special and or use field to id, then this:
{fabrik view=form id=1 usekey=user_id rowid=[$my->id]}
displays nothing.

what could be wrong?
 
As I've said: In the list access you must use an element which is holding the userID, not id (the record id).

in the wiki it says it would only show 1 element for editing
No, it shows only one record for editing.
 
Last edited:
so I changed the user and userdetails list access to user_id but nothing changed!
this
{fabrik view=form id=1 usekey=user_id rowid=[$my->id]}
still displays the whole form
 
this
{fabrik view=form id=1 usekey=user_id rowid=[$my->id]}
still displays the whole form
It IS for displaying the form, what do you expect?

Hmm, I think the "or field" access is not working with usekey (there should be a thread or a GitHub issue somewhere).
Set access to public and a prefilter for showing only the user's record(s).
 
I'd expect just 1 record for editing, as described in the wiki:

Load form 1, and look for an existing record where the 'user' element has a value of 62. If the record is found, the record will be loaded for editing; if not found, a new record can be entered.
Code (Text):
{fabrik view=form id=1 usekey=user rowid=62}
 
OK, just to clear this up, after a Skype session with joit ...

The 'usekey' option isn't anything to do with "only show this element on the form". What it does is tell Fabrik to use something other than the 'id' (primary key) as the "rowid" for loading a form.

So, say you have a form with the usual id element, and a vendor_id element (and you only have one row per vendor, so the vendor_id is unique). And lets say row id 2 is for vendor_id 10. You can load that form two ways:

1) The normal way, using the normal PK as the key ...

index.php?option=com_fabrik&view=form&rowid=2

... which under the hood generates a query for loading that form that has "WHERE yourtable.id = 2"

2) Or by telling Fabrik to use the vendor_id column as the one to look up, and specifying the vendor ID instead of the normal rowid ...

index.php?option=com_fabrik&view=form&usekey=vendor_id&rowid=10

... which generates "WHERE yourtable.vendor_id = 10"

So that way you can load the page for vendor 10 without having to know the "real" rowid.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top