Re: Submitting Data Between Controllers and Validating Correctly

2006-10-03 Thread [EMAIL PROTECTED]
H seems strange that RequestHandler would work without the component being included and even stranger that it would work in a diff way! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-03 Thread AD7six
[EMAIL PROTECTED] wrote: H seems strange that RequestHandler would work without the component being included and even stranger that it would work in a diff way! Not sure what that means ;). Why do you have a comment/add element? that doesn't help what you are trying to do. You need to

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-03 Thread [EMAIL PROTECTED]
Hey AD7six, Yeah, ive gone abit OTT with the elements and gone and got myself confused :( the only bit that should need to be a element if im right would be the part that displays the comments? I cant get on IRC atm as im at work and my only access to IRC is thru a webclient thats locked on

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-03 Thread AD7six
Phunkster, Are you not able to connect here: http://irc.cakephp.org/irc.html? I don´t think the add comment element is not a terrible idea (it would remove the need for a request action call in your post view, which will speed things up) but it may well lead to confussion. You may find that

Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread [EMAIL PROTECTED]
Im setting up a simple blog system and i currently have a comments form on the view page of my posts. The comment form submits and updates the post via AJAX, but how would i go about adding the correct form of validation to the post form? As it stands it seem to request comments/add.thtml, but

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread Kjell
[EMAIL PROTECTED] schrieb: As it stands it seem to request comments/add.thtml, but if i add that it then trys to included a fully render page with the apps layout/default.thtml this of course will cause issuse with the page style. Hi phunkters! For Ajax Requests you should prefix the url

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread [EMAIL PROTECTED]
So what is the correct way of creating a AJAX enabled form that will submit to another controller and update the current page - while also working with JS disabled? Is using the $ajax-form() the best way? I guess i should just go make it work without AJAX then come back and add that in once i

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread AD7six
Hi Phunkster, There's more than one way to do things but: don´t prefix your urls with /ajax/. It´s simply not necessary and will further complicate things. 1) If you include the RequestHandler component, it will ensure that normal requests have a layout, and ajax requests do not. 2) Regarding

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread [EMAIL PROTECTED]
Thanks AD7six, I'll have a look over some of your examples you have linked me too, i think that adding /ajax/ sounded right. Lets hope i get this going :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread [EMAIL PROTECTED]
AD7six, what are your reasons for using elements? is this just so it simpler to reload the content on submission? I gave it a quick go but had issues with it rendering the element --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread AD7six
Hi Phunkster, preamble: the message error rendering element means that the element couldn't be found - check file names etc, assuming you have a recent version of cake. Elements are used for 2 reasons: 1) To be able to reuse code across controllers (DRY) 2) To keep view files simpler Without

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread [EMAIL PROTECTED]
http://www.cakephp.org/pastes/show/9c81a4ea44d8187162db1aab9749df10 There a past of the current code for displaying http://cake.phunky.co.uk/posts/view/1 It is now updating via Ajax but pulling back the full page and not doing any form of validation, i know im close... but i think there is

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread [EMAIL PROTECTED]
Im still struggling with this, is there anything i should be doing in the comments_controller::add ? It seems to pull back the rendered add page, instead of just updating the comments field --~--~-~--~~~---~--~~ You received this message because you are

Re: Submitting Data Between Controllers and Validating Correctly

2006-10-02 Thread Eric C Blount
As AD7six said earlier, you need to include the RequestHandler component in the controller's $helpers array. I think that'll fix it, as Cake is rendering the entire page, and RequestHandler should make sure that doesn't happen with an AJAX request. Someone correct me if I'm wrong... Eric On