master detail forms

We do have Ajax based form submission using Mocha popups.

Create a database join element on one of your related tables, pointing back to the main table. Then on the main table, at the bottom of the 'Data' tab you'll see "Related Data". Enable the 'form' option. Your main table will now have an "Add" link which will create a new form for the related table, using a Mocha popup.

-- hugh

I tried to play with this. I do not see anything under "Related Data" despite having 4 database join fields. Maybe because these are external tables and not "joomla" tables?
 
shouldn't matter

lets say you had 2 tables, schools and students

students has a field 'school_id' which is a database join element pointing to the schools table

edit the schools table and under the 'data' tab in the 'related data' section you should see a line for the students table.

On a separate note, the (very beta) package section would allow you to have a table and a form on the same page, which interact via ajax allowing you to select a record from the table to be loaded into the form and upon saving the form would update the table's data.
 
Hmmm...I'm just not seeing anything there. Here's 2 screenshots (1 showing 3 dbjoin fields) and the other showing the data tab with nothing appearing under related data. I've pm'd hugh credentials for the site.

I also added database layout showing the design of the database (although pngs seem to be losing resolution when i upload them). Uploaded the design doc to

http://picasaweb.google.com/lh/photo/Z4Xu-Dg3hoLna5RtCY2FWQ?authkey=4er7m9S7XGc

Entries has two FK's (one pointing to a unit and another to an event). The other join(s) are just lookup tables.
 

Attachments

  • Tournament_of_Bands_-_Administration_-_Mozilla_Firefox-20081106115307.png
    Tournament_of_Bands_-_Administration_-_Mozilla_Firefox-20081106115307.png
    16.1 KB · Views: 251
  • Tournament_of_Bands_-_Administration_-_Mozilla_Firefox-20081106115452.jpg
    Tournament_of_Bands_-_Administration_-_Mozilla_Firefox-20081106115452.jpg
    56.2 KB · Views: 259
  • tobscores-design.jpg
    tobscores-design.jpg
    11.3 KB · Views: 248
Well I've sort of reach something vaguely similar to what I want to get to.

http://www.njatob.org/index.php?option=com_fabrik&view=table&tableid=26&calculations=0&Itemid=98

You'll have to sign in using the credentials I pm'd Cheesgrits as I'm not allowed to make this site public yet.


I have a few issues with this table:

1) the filter field defaults to no selection. is there a way to specify a default value?

2) can i control the sort order of the filter field (i'd like list event by date -- in fact if the date was part of the filter label that would be great)

3) i dont want the filter field to appear in the table (its already displays in the filter and is redundant) but when i supress it the filter pull-down also disappears !!

4) i'd like to add some heading fields related to the filter (the event date, time, and location) above the table body itself.

5) can i add an order by statement to be applied to the table when displayed. i did this by creating a view BUT the view doesnt play nice with Fabrik (i cant edit data).
 
Hmm, that design image you posted worries me. Are you using InnoDB with FK's? If so ... don't. Fabrik manages join relationships, having something else 'underneath' Fabrik also trying to manage relationships confuses the poop out of Fabrik. You can still use InnoDB as your engine, just don't use any of the funky features of InnoDB. And if you aren't using any of the InnoDB funky features, you might as well use MyISAM ... if you've ever had a corrupted InnoDB table you have to recover, you'll know why I'm advising you to use myISAM!

If you aren't using InnoDB, ignore the above rant. :)

Also, I think you have your joins on the wrong table. They need to be on the related tables, pointing back to the PK of the main table. Not on the main table pointing to the PK's of the related tables. Then they will show up on the 'related data'.

So ... lets get that stuff sorted out before moving on to your plethora of other questions.

-- hugh
 
No I'm not using InnoDB. I imported a sql dump and drew the relationships. AFAIKS the mysql itself doesnt know crap about which table is related to which.

I'm pretty sure the joins are correct however. Units and Events are supplementary tables to Entries. Many bands can be entered into one event. Many events can be attended by one band. A band can only have a single entry at each event. An event can only have a single entry for each band.

Of course I may be configuring Fabrik incorrectly to represent these relationships...

BTW the credentials I pm'd are good for the backend too. Feel free to look at stuff yourself.
 
Also, I think you have your joins on the wrong table. They need to be on the related tables, pointing back to the PK of the main table. Not on the main table pointing to the PK's of the related tables. Then they will show up on the 'related data'.
-- hugh

I played with this some more and can't imagine how I'd join the Units table to Entries table. There isn't a foreign key in Units. Same goes for Events -- it doens't contain a foreign key.

I'm getting worried here that no one has actually *looked* at what I'm trying to do. I gave a pretty clear description of the app in the first post. I also have posted links back to the website. The db design is the standard representation for what's in reality many to many relationship; many units can appear in many events. I can't believe you'd have said the joins were wrong if you had looked at the actual tables.

My "plethora" (5) questions linked to a specific example which was getting me a first approximation of the results I need. I subscribed 'cause I thought I'd get some specific help but instead I get either "I have to wait until Rob is back" or "It looks like your db is using Inno" or "Your joins are wrong".

I understand that bad db design will cause Fabrik to function improperly. I don't think the db is designed poorly. In fact it's pretty obvious (if you'd actually look at the site) that the joins are formed properly. What possible foreign key could the Units DB contain that would make any sense at all with respect to Entries? I'm sorry if I'm way off-base here. I'm just looking to make some progress and not making a lot.
 
I did look at the site. I checked your Units table on the backend, and the "Related Data" we told you would be there, is there.

To provve this, I just enabled 'view' and 'add' for "Events" under Related Data on your Units table. Take a look at your Units table, on the front or back end, you will see two new columns.

The 'view' link will open a filtered table on the Events table, showing all events for that unit row. The 'add' link will bring up a new Events form, with the link to Units pre-filled.

This is what we call 'faceted browsing', as described to you by both myself and Rob in this thread. It may or may not be what you want to do. But it's hard to tell what you need, when we tell you to try something and you don't try it.

My apologies for thinking you might have been using InnoDB, but in the MySQL world, Foreign Keys are an InnoDB invention. Google "MySQL foreign keys". It would make things simpler and avoid confusion if you refered to them as 'joins' or 'join elements'.

I understand your frustration, but please understand mine. Go back and read this thread, and put yourself in my shoes of trying to understand exactly what you are trying to do. Bear in mind that you are living and breathing your one app, whereas I'm trying to understand your app structure and requirements from a standing start, whilst simultanously doing the same for numerous other users.

So, as I said, lets take a step back and establish exactly how you need to structure your app. There are other ways of achieving what you want to do, specifically to build "real" one-to-many relationships between your tables. See the "widgets and gidgets" example here:

http://fabrikar.com/forums/showthread.php?p=30558&highlight=widgets+gidgets#post30558

... which was written for 1.0.x, but applies to 2.0 as well. Rather than immediately trying this on your existing tables, I'd suggest building a quick widgets/gidgets example so you can see what this does for you.

-- hugh
 
Enjoyed out Skype session just now.

Sorry I had to drop the call in a hurry, I had one come in from my Day Job boss I had to take in right away.

I'll be working on your site some more this evening.

-- hugh
 
No problems! I've left all but the main 3 tables unpublished. I'll be away for most of the weekend (until later Sunday evening).

I do encourage you to have a peek at the entry2 table. It does do a lot of what I'm trying to do (less the 5 issues I posted earlier in the thread).
 
Just to let you know we haven't forgotten about you. I've got Rob looking at your site now, for that related data bug. Looks like it may be a bug in the filtering we thought we'd already fixed.

-- hugh
 
Can you update to the latest SVN? We just committed a bunch of changes, a collection of little bug fixed Rob made for the Linux Expo but has only just committed to SVN.

Hoping this will at least fix the lack of data on the fitered table.

-- hugh
 
I updated to rev701. Everything editing-wise seems to work. However when I try to view a table I get

500 - An error has occurred.

Layout "default" not found

BTW I logged you out before I updated to rev701.

eXtplorer is available on the site if that will help.
 
That layout bug should now now be fixed in latest SVN. If not, as per our IM session, just save each of the tables one time.

BTW, can you super-admin me? I can't use exTplorer without being a superadmin.

FYI, we found and fixed another bug, caused by not being a super-admin ... or rather, this tickled a bug that prevented forms and groups from showing on the backend if you weren't a superadmin (the query that hides the built-in 'events' table from non-superadmins was breaking). Now fixed in latest SVN.

-- hugh
 
OK, so where are we at?

Now that we've gotten the 'related data' stuff working, does that look like what you need?

Or do you think you might need the 'one-to-many' (widgets & gidgets) relationship?

-- hugh
 
the related date adds some features i wanted to get to so its helpful.

where i'm trying to get is a screen where i can "manage" the units who are entered in an event (add and delete units, edit entries).

have a look at entries2. it's nearly what i'm after. but i have a few q's about it...

1) the filter field defaults to no selection. is there a way to specify a default value? i really dont have a need to display all the entries in that screen.

2) can i control the sort order of the filter field (i'd like list event by date -- in fact if the date was part of the filter label that would be great)

3) i dont want the filter field to appear in the table (its already displays in the filter and is redundant) but when i supress it the filter pull-down also disappears !!

4) i'd like to add some heading fields related to the filter (the event date, time, and location) above the table body itself.

5) can i add an order by statement to be applied to the table when displayed. i did this by creating a view BUT the view doesnt play nice with Fabrik (i cant edit data).

(yes these are the same 5 q's before we diverted (with good result) to faceted views.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top