Suggested solution to your master/detail presentation:

1) When chosing (or after having added) the Tender store the tender id
in the session (possibly the model already does this, haven't
checked).
2) When activating "New tender document" use an element in your
tender_documents add view to retrieve and present the current Tender
information (summary).
3) When saving the new tender document, add the tender id from the
session to the data (or from the tender model, should the model
already have this information).

Enjoy,
   John


On Dec 6, 9:47 am, csplrj <[email protected]> wrote:
> I am using "hasMany" Relationship with cakephp.
>
> I have relationship like
>
> Tender=>hasMany=>TenderDocuments
>
> with this kind of relationship.
>
> I am at "http://localhost/cakephp/index.php/tenders/add";
> Now i click "New Tender Document" and 
> gotohttp://localhost/projects/cakephp/index.php/tender_documents/add
>
> What I want is that there should be either no display of tender combo
> as i want it to be directly associated with the tender from where the
> Tender that I am currently adding.
>
> How to achive the same?
>
> This is a kind of one-to-many relationship
>
> Thanks in advance
>
> CSJakharia
>
> My Code is like this
>
> class Tender extends AppModel
>         {
>                 var $name='Tender';
>                 var $hasMany=array('TenderDocument'=>array(
>                         'className'=>'TenderDocument',
>                         //'conditions' => array('Tender.id = 
> TenderDocument.tender_id'),
>                         'order'=>null,
>                         'foreignKey'=>'tender_id',
>                         'exclusive'=>false,
>                         'dependent'=>true
>                 ));
>         }
>
> <?php
>         class TenderDocument extends AppModel
>         {
>                 var $name='TenderDocument';
>                 var $belongsTo=array('Tender'=>array(
>                         'className'=>'Tender',
>                         'conditions'=>null,
>                         'order'=>null,
>                         'foreignKey'=>'tender_id'
>                 ));
>         }
> ?>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to