View details problem

Status
Not open for further replies.

jflowers

New Member
I have a Fabrik 1.0.6 form linked to a database table that does everything that I want. Unfortunately, when I click on the 'View' link for any record in the multi-record set, the displayed result has the field values for the last record in it. The link (see below) appears to be correct as the values for fabrik__cursor and linkindex increment with the record count. The field values are correct in the display of the multiple records.

<a href="http://www.malcopro.com/index.php?option=com_fabrik&amp;task=viewTableRowD etails&amp;tableid=7&amp;fabrik=9&amp;rowid=44203& amp;Itemid=810&amp;fabrik__cursor=0&amp;fabrik__total=1" linkindex="5" set="yes">View</a>
 
When I'm not working on it the View link is turned off so that potential customers don't get confused. It's turned back on now. For a multi-record result use zip code 44203.
 
What do you have set as the PK for your table?

Do you have a 'detailed view link' set on the table or any of the elements? If so, what is it.

-- hugh
 
The primary key in the 'View Dealer' table is `zipcode`. It is not unique. In the physical database there is a unique key comprised of `zipcode`, `state` and `county` but it is not available in the Fabrik 'View Dealer' table.

The 'detailed view link' checkbox is checked for the 'View Dealer' table. It is cleared for all the elements. When I checked the 'Links to detailed view' checkbox for the zipcode, state and county elements they became clickable but the behavior was the same as the 'View' link.
 
Hmmmmm. I'm pretty sure this won't work in Fabrik. We don't (yet) support the concept of multiple element unique keys. So when the form is asked to load rowid=44203 (the zip being the PK), we just select on that, and just load the first result that MySQL returns (which will usually be the last record added).

You'll have to modify your table to include a 'vanilla' primary key, just a plain incrementing integer dealer_id, and use that as the PK.

So Fabrik Rule #1, all tables must have a single unique PK column.

-- hugh
 
OK, that all holds together with my observations and I should be able to work it out after I add an id field to the db.

Good Rule #1 to remember.

Maybe the easy way to implement in the future would be to make the mysql indices available. The zipcode+state+county unique key is called zipcode2 in this instance. That way you let mysql do the hard work.

Thanks for all the help.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top