Thanks franky. I think this is the way to go.

On Jun 17, 11:46 am, francky06l <[EMAIL PROTECTED]> wrote:
> If you want to render a new view when searching, you should not use
> ajax but "normal" submit, then the complete view will be rendered ...
> Maybe I misunderstood the problem.
> hth
>
> On Jun 17, 6:26 am, Shahzad <[EMAIL PROTECTED]> wrote:
>
> > Thank you very much for you reply. Though I have solved the problem by
> > putting some javascript code in my ctp file and setting a variable in
> > my controller. But this seems a bit unprofessional to me. Let me try
> > to rephrase my problem:
>
> > I have anelementsearch.ctp. I have included it ($this->element) in
> > my default layout (so it will appear on every page). I have a search
> > button (and there is a search action in my controller). Based on the
> > search word (provided by the user input) I will have to search the
> > database and fetch the matching result and then display the results in
> > another view (not anelement) result.ctp. If I use theredirectfrom
> > my controller action then this will display the result.ctp within the
> > searchelement(I don't want that). I want to render the new view
> > altogether.
>
> > Thank you.
>
> > On Jun 6, 10:06 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > One doesn't "redirect" from anelement. I think what you mean is that
> > > you have a form submit button and that clicking it results in some new
> > > layout elements being added asynchronously to the search div. Do you
> > > have some javascript code attached to the form to get the results
> > > using XHR / AJAX? If so, you need to modify the search method in the
> > > controller to keep it from rendering a layout:
>
> > > $this->layout = false;
>
> > > Also, have a look at the RequestHandler component.
>
> > > On Fri, Jun 6, 2008 at 2:33 AM, Shahzad <[EMAIL PROTECTED]> wrote:
>
> > > > I have anelementsearch.ctp, it has a simple text box and a search
> > > > button. When ever I press the search button and try toredirect(from
> > > > my controller action), It displays the redirected page with in the
> > > >element. What am I doing wrong? How do Iredirectthe whole page?
>
> > > > Thank you
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to