Sunday, May 30, 2010

Re: Select options after validate are not displayed

And you say they are not re-populating after validation? Check to be sure that your queries are not not nested in something like this: 

if(empty($this->data))
{
     // your queries here
}

-Ed 

On Sun, May 30, 2010 at 3:20 PM, Ziki <zixwebs@gmail.com> wrote:
No, same controller, same action.

On 30 svi, 21:27, Ed Propsner <crotchf...@gmail.com> wrote:
> Are you submitting the form to a different controller or action other than
> the one where you are setting your select values?
>
> - Ed
>
> On Sun, May 30, 2010 at 2:22 PM, Ziki <zixw...@gmail.com> wrote:
> > I have that problem that after validation, when it is again diplayed
> > my form with error messages, there are no options in select fields. It
> > is because options in select filds are variables declared and defined
> > in controller action, so after validation thoose variables aren't
> > declared and defined. What should I do?
>
> > This is controllers variables:
>
> > $acctypes = $this->Acctype->find('list',array(
> >                                'fields' => array('id','title')
> >                        ));
> > $cities = $this->City->find('list',array(
> >                                'fields' => array('id','title')
> >                        ));
> > $facilities = $this->Facility->find('list',array(
> >                                'fields' => array('id','title')
> >                        ));
> > $this->set(compact('cities','acctypes','facilities'));
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: