Zend framework cant get session variable to display in form

I am getting familliar with zend framework and I have a form which data is saved in a database and then also stored in a zend session so that it can be retrieved and used in another controller.

The thing is when I do a

print_r(print_r($this->SessionGroupLoans->data);

where data is the variable that holds the form entries from the provious form as an array,
I see the session data that has been stored ok

Array ( [id] => GH4C9C2EAB6A82D [groups_id] => GH4C8801A07291B [loan_amount] => 7000.00 [loan_start] => 2010-09-01 [grace_period] => Yes [payment_start] => 2010-09-06 [loan_duration] => 13 [loan_end] => 1970-01-01 [group_daily_payment] => 120.17 [loan_cycle_number] => 1 [loan_purpose] => To Be Supplied [commitment_fee] => 70.00 [repayment_frequency] => Daily [interest_payable] => 210 [loan_amount_payable] => 7000.00 [total_amount_payable] => 7210.00 [amount_remitted] => 7140.00 [date_created] => 2010-09-24 05:52:59 ) 

However when I do

       
 // Add the Group Loan Id element
        $groups_loan_id = $this->createElement('Select', GroupsLoanId);
        $groups_loan_id->setLabel('Select Group Loan ID:')
                ->setAttrib('size', '1')
                ->addValidator('StringLength', FALSE, array(3, 50))
                ->setRequired(TRUE);

                foreach($groupsloans as $u)
                    $groups_loan_id->addMultiOption($u->id,$u->id);

                if (isset ($this->SessionGroupLoans->data->groups_id))
                {
                    $groups_loan_id->setValue($this->SessionGroupLoans->data->groups_loan_id);
                }

the group id is not populated in the form :confused: This is holding me back big time. Help if you can anyboby.

Seems to be an array syntax rather than zend framework. What if you do this… does it work?


$data = $this->SessionGroupLoans->data;
if (isset ($data['groups_id'])) {               
  $groups_loan_id->setValue($data['groups_loan_id']);
}

thanks descarte that did it.