Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

displaying all associated fields. 31 Jul 2012 06:41 #2938

Ok so i have a component where you can set up a venue location by filling in all its details e.g name, location e.t.c. now i want to be able to associate rooms to that venue using a seperate table e.g. on the seperate table you create new room and there is a drop down foreign key of all the venues you select one and give the room a name and fill in its details and click save. ok all nice and easy so far. now on a seperate table/page i want to choose a venue from an fkey and for it to display all the rooms associated with that venue. any one able to help or at least point me in the right direction?

Please Log in or Create an account to join the conversation.

Re: displaying all associated fields. 31 Jul 2012 14:16 #2939

You could use a filter, otherwise you can search for master detail form. Using a master detail form means you need to code outside of cook.

Please Log in or Create an account to join the conversation.

Re: displaying all associated fields. 01 Aug 2012 09:36 #2947

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
You can use the filters to see them in a new page.


But if you want to obtain a single page with your main item (location), and your related items below (rooms), the best is to merge the two views in the same.

A little bit of code is required both in you VIEW file and TMPL files

TODO :
Create a layout displaying filtered rooms (by location)

TO CODE :
Extract from this layout all the code and merge it properly (copy & paste don't work) in your main layout (location)
Then, instead of using a filters, connect the value of the main item, to filter the model of your rooms
(model->addWhere(.....))

I explained this many times in the forum and it is a very nice exercice to understand your component.
(It is the very first step)

Try even to do it by yourself, following this map. Read the files and try to understand, it will save you a lot of time once you've got the concept. (VIEW and TMPL is the most easy part)

I hope it helps.

A documentation of Cook (and coding components) will start to be written after the V2.0.
For the moment, V1.x is a draft, so there is no-sense to write an obsolete documentation.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.060 seconds

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started