Re: unset($this->params['data']) Not Working???

2006-05-23 Thread John Zimmerman [gmail]
http://wiki.cakephp.org/tutorials:flashingFor some reason I missed this page in the wiki before I got started and mucked around writing new functions.
On 5/22/06, josh southern <[EMAIL PROTECTED]> wrote:
stephenrs, thanks for the reply. That will work fine with minimalchanges to my app.I still would like to know why the unset() function stopped workingwith 1.0? It could help me solve other problems down the road...
X-Google-Language: ENGLISH,ASCII-7-bitReceived: by 10.11.88.14 with SMTP id l14mr42075cwb;Mon, 22 May 2006 08:53:37 -0700 (PDT)X-Google-Token: j1BK8AwAAAD_n4v4ENmRTIH6jH2K7NuB
Received: from 68.216.187.39 by y43g2000cwc.googlegroups.com with HTTP;Mon, 22 May 2006 15:53:37 + (UTC)From: "josh southern" <
[EMAIL PROTECTED]>To: "Cake PHP" <cake-php@googlegroups.com>Subject: Re: unset($this->params['data']) Not Working???
Date: Mon, 22 May 2006 08:53:37 -0700Message-ID: <[EMAIL PROTECTED]>In-Reply-To: <
[EMAIL PROTECTED]>References: <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.2,gzip(gfe),gzip(gfe)X-HTTP-Via: 1.1 proxy2-jan.integrity.com:80
 (squid/2.5.STABLE12)Mime-Version: 1.0Content-Type: text/plainstephenrs, thanks for the reply. That will work fine with minimalchanges to my app.I still would like to know why the unset() function stopped working
with 1.0? It could help me solve other problems down the road...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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  -~--~~~~--~~--~--~---


Re: unset($this->params['data']) Not Working???

2006-05-22 Thread josh southern

stephenrs, thanks for the reply. That will work fine with minimal
changes to my app.

I still would like to know why the unset() function stopped working
with 1.0? It could help me solve other problems down the road...

X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.11.88.14 with SMTP id l14mr42075cwb;
Mon, 22 May 2006 08:53:37 -0700 (PDT)
X-Google-Token: j1BK8AwAAAD_n4v4ENmRTIH6jH2K7NuB
Received: from 68.216.187.39 by y43g2000cwc.googlegroups.com with HTTP;
Mon, 22 May 2006 15:53:37 + (UTC)
From: "josh southern" <[EMAIL PROTECTED]>
To: "Cake PHP" 
Subject: Re: unset($this->params['data']) Not Working???
Date: Mon, 22 May 2006 08:53:37 -0700
Message-ID: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418 
(KHTML, like Gecko) Safari/417.9.2,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 proxy2-jan.integrity.com:80 (squid/2.5.STABLE12)
Mime-Version: 1.0
Content-Type: text/plain

stephenrs, thanks for the reply. That will work fine with minimal
changes to my app.

I still would like to know why the unset() function stopped working
with 1.0? It could help me solve other problems down the road...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-22 Thread John Zimmerman [gmail]
I believe that is exactly what I wanted now that you lay it out like that.Thanks for dumbing it down for me.  I think I was missing how to get it into the view.I will test this out in my app and procede to remove my code bloat that I previously posted.
Thanks again.On 5/22/06, stephenrs <[EMAIL PROTECTED]> wrote:
The solutiion was really alluded to in AD7six's first post on thisthread, but I'll try to lay ouot more clearly how I've done this.Assuming you're adding Posts, you need something like this in the add()method of your controller:
function add(){if ($this->Post->save($this->params['data'])){$this->Session->setFlash('The post has been saved', 'default');$this->redirect('posts/add');
}}This will store the message in the session for later retrieval in yourlayout (named 'default' in this example.So, somewhere in your default.thtml layout put this code:php if (isset($this->controller->Session))
$this->controller->Session->flash();?>This will display the message stored in the session by the controllerabove, and then show the contents of your "add" view (add.thtml) -
because we redirected to 'posts/add' above.No extra functions or session variables, and no flash screen in betweensteps. It just saves the Post and then shows a new empty Post form,with the status message displayed on the same page. I know this works
because I've released it to QA testing for a client's internal admintool.I hope I've understood what the original question was on this thread,and I hope this helps.

Re: unset($this->params['data']) Not Working???

2006-05-22 Thread stephenrs

The solutiion was really alluded to in AD7six's first post on this
thread, but I'll try to lay ouot more clearly how I've done this.
Assuming you're adding Posts, you need something like this in the add()
method of your controller:

function add()
{
if ($this->Post->save($this->params['data']))
{
$this->Session->setFlash('The post has been saved', 'default');
$this->redirect('posts/add');
}
}

This will store the message in the session for later retrieval in your
layout (named 'default' in this example.

So, somewhere in your default.thtml layout put this code:

controller->Session))
$this->controller->Session->flash();
?>

This will display the message stored in the session by the controller
above, and then show the contents of your "add" view (add.thtml) -
because we redirected to 'posts/add' above.

No extra functions or session variables, and no flash screen in between
steps. It just saves the Post and then shows a new empty Post form,
with the status message displayed on the same page. I know this works
because I've released it to QA testing for a client's internal admin
tool.

I hope I've understood what the original question was on this thread,
and I hope this helps.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-22 Thread John Zimmerman [gmail]
I am still new to cake but am getting everything figured out.If I can acomplish the same thing more simply using built in cake functions I am all for it.Here is a link to my test site where I am experimenting...
http://cake-sandbox.zimmproject.com/users/loginIf you press the "login" button with no info in the blanks you will see the desired effect we are after.  That is the code that I posted earlier in action.
I am attempting something similar with the setFlash() method but so far I have a no go.I am working through the dynamic text link you posted, but I need to pear it down to just the functionality we are looking for, right off the setFlash calls are not straight forward to me.
Thanks for all the replies.On 5/22/06, AD7six <[EMAIL PROTECTED]> wrote:
In fact, to save myself some bandwidth, and make use of the wiki see:http://wiki.cakephp.org/tutorials:i18n#messages_dynamic_content
Cheers,AD7sixX-Google-Language: ENGLISH,ASCII-7-bitReceived: by 10.11.53.63 with SMTP id b63mr116216cwa;Mon, 22 May 2006 00:58:51 -0700 (PDT)X-Google-Token: HWJtRAwAAACKSxoxUwvYuUK7w_O7vc8Z
Received: from 80.59.216.205 by i39g2000cwa.googlegroups.com with HTTP;Mon, 22 May 2006 07:58:51 + (UTC)From: "AD7six" <
[EMAIL PROTECTED]>To: "Cake PHP" <cake-php@googlegroups.com>Subject: Re: unset($this->params['data']) Not Working???
Date: Mon, 22 May 2006 00:58:51 -0700Message-ID: <[EMAIL PROTECTED]>In-Reply-To: <
[EMAIL PROTECTED]>References: <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]
>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>User-Agent: G2/0.2X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 
5.0; es-ES; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3,gzip(gfe),gzip(gfe)Mime-Version: 1.0Content-Type: text/plainIn fact, to save myself some bandwidth, and make use of the wiki see:
http://wiki.cakephp.org/tutorials:i18n#messages_dynamic_contentCheers,AD7six

Re: unset($this->params['data']) Not Working???

2006-05-22 Thread AD7six

In fact, to save myself some bandwidth, and make use of the wiki see:
http://wiki.cakephp.org/tutorials:i18n#messages_dynamic_content

Cheers,

AD7six

X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.11.53.63 with SMTP id b63mr116216cwa;
Mon, 22 May 2006 00:58:51 -0700 (PDT)
X-Google-Token: HWJtRAwAAACKSxoxUwvYuUK7w_O7vc8Z
Received: from 80.59.216.205 by i39g2000cwa.googlegroups.com with HTTP;
Mon, 22 May 2006 07:58:51 + (UTC)
From: "AD7six" <[EMAIL PROTECTED]>
To: "Cake PHP" 
Subject: Re: unset($this->params['data']) Not Working???
Date: Mon, 22 May 2006 00:58:51 -0700
Message-ID: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; es-ES; rv:1.8.0.3) 
Gecko/20060426 Firefox/1.5.0.3,gzip(gfe),gzip(gfe)
Mime-Version: 1.0
Content-Type: text/plain

In fact, to save myself some bandwidth, and make use of the wiki see:
http://wiki.cakephp.org/tutorials:i18n#messages_dynamic_content

Cheers,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-22 Thread AD7six

There's a significant difference between the controller "flash" method
and the session "setFlash" method; I´m not sure all contributors to
this thread are aware of that...

@JZ: that´s a phenomenal amount of code, to rewrite the
already-existing session flash mechanism. Check the source of the
Session component, method "setFlash"

@anyone: http://www.noswad.me.uk/demos/Posts/add , and if it does what
you want (uses cake methods) - click the "download source" link and
browse away ;)

Cheers,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-21 Thread John Zimmerman [gmail]
The part he is trying to avoid is the display of the page that just says "Your data has been saved" without the form.I am not sure that your solution will accomplish this but I will give it a try.  It seems like it would just skip the message all together.
On 5/21/06, stephenrs <[EMAIL PROTECTED]> wrote:
This functionality can be achieved without writing any new functions.I'm building a similar app designed for rapid data input, and my needsare similar to yours. I didn't like the flash() function either, but
(as described above) the following works just fine for displaying amessage at the top of a new empty form:$this->Session->setFlash ("Your enhancement has been saved, Go on, addanother one!");
$this->redirect ($this->controller/action);Why write a new status message handling mechanism when one alreadyexists in Cake (the flash message)? Doing it this way also means youdon't have to do anything to your view.
I also go a bit further, because sometimes my users want to save, thenfill out a new form which gets input which is very similar to the onethey just saved. For this I just do the save, set the flash session
variable to my message, unset the hidden variable$this->params['data']['id'], and let the rest of $this-params['data']fall through to the new form - prefilled for them.I'm very new to Cake and this forum, so please be easy on me if I'm
missing something.Thanks.X-Google-Language: ENGLISH,ASCII-7-bitReceived: by 10.11.53.63 with SMTP id b63mr108369cwa;Sun, 21 May 2006 14:43:56 -0700 (PDT)
X-Google-Token: CPrwZAwAAABYAEzqRWqvUVzA2zj5_XCLReceived: from 24.199.110.213 by j33g2000cwa.googlegroups.com with HTTP;Sun, 21 May 2006 21:43:56 + (UTC)
From: "stephenrs" <[EMAIL PROTECTED]>To: "Cake PHP" <cake-php@googlegroups.com>Subject: Re: unset($this->params['data']) Not Working???
Date: Sun, 21 May 2006 14:43:56 -0700Message-ID: <[EMAIL PROTECTED]>In-Reply-To: <
[EMAIL PROTECTED]>References: <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>   <
[EMAIL PROTECTED]>User-Agent: G2/0.2X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3,gzip(gfe),gzip(gfe)
Mime-Version: 1.0Content-Type: text/plainThis functionality can be achieved without writing any new functions.I'm building a similar app designed for rapid data input, and my needsare similar to yours. I didn't like the flash() function either, but
(as described above) the following works just fine for displaying amessage at the top of a new empty form:$this->Session->setFlash ("Your enhancement has been saved, Go on, addanother one!");
$this->redirect ($this->controller/action);Why write a new status message handling mechanism when one alreadyexists in Cake (the flash message)? Doing it this way also means youdon't have to do anything to your view.
I also go a bit further, because sometimes my users want to save, thenfill out a new form which gets input which is very similar to the onethey just saved. For this I just do the save, set the flash session
variable to my message, unset the hidden variable$this->params['data']['id'], and let the rest of $this-params['data']fall through to the new form - prefilled for them.I'm very new to Cake and this forum, so please be easy on me if I'm
missing something.Thanks.

Re: unset($this->params['data']) Not Working???

2006-05-21 Thread stephenrs

This functionality can be achieved without writing any new functions.
I'm building a similar app designed for rapid data input, and my needs
are similar to yours. I didn't like the flash() function either, but
(as described above) the following works just fine for displaying a
message at the top of a new empty form:

$this->Session->setFlash ("Your enhancement has been saved, Go on, add
another one!");
$this->redirect ($this->controller/action);

Why write a new status message handling mechanism when one already
exists in Cake (the flash message)? Doing it this way also means you
don't have to do anything to your view.

I also go a bit further, because sometimes my users want to save, then
fill out a new form which gets input which is very similar to the one
they just saved. For this I just do the save, set the flash session
variable to my message, unset the hidden variable
$this->params['data']['id'], and let the rest of $this-params['data']
fall through to the new form - prefilled for them.

I'm very new to Cake and this forum, so please be easy on me if I'm
missing something.

Thanks.

X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.11.53.63 with SMTP id b63mr108369cwa;
Sun, 21 May 2006 14:43:56 -0700 (PDT)
X-Google-Token: CPrwZAwAAABYAEzqRWqvUVzA2zj5_XCL
Received: from 24.199.110.213 by j33g2000cwa.googlegroups.com with HTTP;
Sun, 21 May 2006 21:43:56 +0000 (UTC)
From: "stephenrs" <[EMAIL PROTECTED]>
To: "Cake PHP" 
Subject: Re: unset($this->params['data']) Not Working???
Date: Sun, 21 May 2006 14:43:56 -0700
Message-ID: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) 
Gecko/20060426 Firefox/1.5.0.3,gzip(gfe),gzip(gfe)
Mime-Version: 1.0
Content-Type: text/plain

This functionality can be achieved without writing any new functions.
I'm building a similar app designed for rapid data input, and my needs
are similar to yours. I didn't like the flash() function either, but
(as described above) the following works just fine for displaying a
message at the top of a new empty form:

$this->Session->setFlash ("Your enhancement has been saved, Go on, add
another one!");
$this->redirect ($this->controller/action);

Why write a new status message handling mechanism when one already
exists in Cake (the flash message)? Doing it this way also means you
don't have to do anything to your view.

I also go a bit further, because sometimes my users want to save, then
fill out a new form which gets input which is very similar to the one
they just saved. For this I just do the save, set the flash session
variable to my message, unset the hidden variable
$this->params['data']['id'], and let the rest of $this-params['data']
fall through to the new form - prefilled for them.

I'm very new to Cake and this forum, so please be easy on me if I'm
missing something.

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-20 Thread John Zimmerman [gmail]
Also, If you want to move as much code out of individual controllers as possible you can put the get message calls into the app_controller.php constructor.
class AppController extends Controller {function AppController(){parent::__constructor();

$systemMessage = $this->getSystemMessage();
$errorMessage = $this->getErrorMessage();if ($systemMessage !=0) {$this->set('systemMessage', $systemMessage);}if ($errorMessage !=0) {
$this->set('errorMessage', $errorMessage);}}}From there your other controller code is less cluttered.  Your view stays the same, just checking to see if the variable is set.
On 5/20/06, John Zimmerman [gmail] <[EMAIL PROTECTED]> wrote:
A work around would be to create a function in your app controller calledsetSystemMessage($message);this function would set a session variable with the message.

Then create another function called ...getSystemMessage()This function will return the contents of the session variable and then unset it.  If the session variable is not set it will return 0.
So in your controller you would setSystemMessage('Success!') then redirect to the same page.Also in your controller before rendering the view you would do the following...

$systemMessage = $this->getSystemMessage();if ($systemMessage !=0) {$this->set('systemMessage', $systemMessage);}In your view to that page you would have an if statement like the following...
if ( isset($systemMessage)) {    echo $systemMessage;}Style the system message by putting it within  or something similar.
You can create the same kind of functions for setErrorMessage and getErrorMessage and do the same thing in the controller/view.  Then style it with This will work just fine as I am doing something similar with another application using another framework.  Using the session variable should clear any of the problems you were having.
On 5/20/06, josh southern <
[EMAIL PROTECTED]> wrote:
The problem with redirect() is that the variable I use to display thesuccess message doesn't carry through. The problem with flash() is thatif a user looks away for a few seconds (let's say the phone rings, or
someone walks into the room), they miss the success message and itcreates confusion as to whether the form worked. Hence my solution ofdisplaying a message on top of a new, blank form. They're already used

to looking there because of the validation error messages, and if theydistracted for a few seconds, they don't miss the success message.This worked fine before, and now with 1.0, it doesn't. Can't someone
tell me why, and if there is a way for me to code a work-around?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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  -~--~~~~--~~--~--~---


Re: unset($this->params['data']) Not Working???

2006-05-20 Thread John Zimmerman [gmail]
A work around would be to create a function in your app controller calledsetSystemMessage($message);this function would set a session variable with the message.
Then create another function called ...getSystemMessage()This function will return the contents of the session variable and then unset it.  If the session variable is not set it will return 0.
So in your controller you would setSystemMessage('Success!') then redirect to the same page.Also in your controller before rendering the view you would do the following...
$systemMessage = $this->getSystemMessage();if ($systemMessage !=0) {$this->set('systemMessage', $systemMessage);}In your view to that page you would have an if statement like the following...
if ( isset($systemMessage)) {    echo $systemMessage;}Style the system message by putting it within  or something similar.
You can create the same kind of functions for setErrorMessage and getErrorMessage and do the same thing in the controller/view.  Then style it with This will work just fine as I am doing something similar with another application using another framework.  Using the session variable should clear any of the problems you were having.
On 5/20/06, josh southern <[EMAIL PROTECTED]> wrote:
The problem with redirect() is that the variable I use to display thesuccess message doesn't carry through. The problem with flash() is thatif a user looks away for a few seconds (let's say the phone rings, or
someone walks into the room), they miss the success message and itcreates confusion as to whether the form worked. Hence my solution ofdisplaying a message on top of a new, blank form. They're already used
to looking there because of the validation error messages, and if theydistracted for a few seconds, they don't miss the success message.This worked fine before, and now with 1.0, it doesn't. Can't someonetell me why, and if there is a way for me to code a work-around?


Re: unset($this->params['data']) Not Working???

2006-05-20 Thread josh southern

The problem with redirect() is that the variable I use to display the
success message doesn't carry through. The problem with flash() is that
if a user looks away for a few seconds (let's say the phone rings, or
someone walks into the room), they miss the success message and it
creates confusion as to whether the form worked. Hence my solution of
displaying a message on top of a new, blank form. They're already used
to looking there because of the validation error messages, and if they
distracted for a few seconds, they don't miss the success message.

This worked fine before, and now with 1.0, it doesn't. Can't someone
tell me why, and if there is a way for me to code a work-around?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-19 Thread John Zimmerman [gmail]
After you process the page use the $this->redirect() to the exact same page.This should clear the values.  Letting the code fall through will result in the values still being present.
The flash will work too, it just displays a message for a second and then you can have it redirect right back to where you were.
So...$this->flash('Success', '/some_controller', 2);or$this->redirect('/some_controller');

On 5/19/06, josh southern
 <[EMAIL PROTECTED]> wrote:

It definitely isn't the browser, as I don't have the auto-fill featureturned on.And it's not that I couldn't use the flash() function, I just thinkit's sort of silly. It would be much quicker for data input to just
display a message on top of another blank form. And the method I'mtrying to employ worked perfectly before version 1, so there isprobably a work-around.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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  -~--~~~~--~~--~--~---


Re: unset($this->params['data']) Not Working???

2006-05-19 Thread John Zimmerman [gmail]
I just read AD7six's reply and it is pretty much the same is mine. sorry.On 5/19/06, John Zimmerman [gmail] <[EMAIL PROTECTED]
> wrote:
After you process the page use the $this->redirect() to the exact same page.This should clear the values.  Letting the code fall through will result in the values still being present.
The flash will work too, it just displays a message for a second and then you can have it redirect right back to where you were.
So...$this->flash('Success', '/some_controller', 2);or$this->redirect('/some_controller');

On 5/19/06, josh southern
 <[EMAIL PROTECTED]> wrote:


It definitely isn't the browser, as I don't have the auto-fill featureturned on.And it's not that I couldn't use the flash() function, I just thinkit's sort of silly. It would be much quicker for data input to just
display a message on top of another blank form. And the method I'mtrying to employ worked perfectly before version 1, so there isprobably a work-around.




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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  -~--~~~~--~~--~--~---


Re: unset($this->params['data']) Not Working???

2006-05-19 Thread josh southern

It definitely isn't the browser, as I don't have the auto-fill feature
turned on.

And it's not that I couldn't use the flash() function, I just think
it's sort of silly. It would be much quicker for data input to just
display a message on top of another blank form. And the method I'm
trying to employ worked perfectly before version 1, so there is
probably a work-around.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-18 Thread AD7six

Hi Josh,

I don't know why that wouldn't work, unless it's something to do with
the browser remembering input (do the field values actually appear in
the html source as value=?)

Anyway it might be more useful to find out why the flash isn't working.

You would only need to do this in the controller:
$this->Session->setFlash ("Your enhancement has been saved, Go on, add
another one!");
$this->redirect ($this->here);

And make sure you have this in the layout somewhere:
controller->Session))
$this->controller->Session->flash(); ?>

If it doesn't work it'll probably be because of some sort of session
problem that will bite eventually.

Hope you find a solution, cheers,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-18 Thread josh southern

Nope.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: unset($this->params['data']) Not Working???

2006-05-18 Thread Armando Sosa
Maybe $this->data="" ?On 5/18/06, josh southern <[EMAIL PROTECTED]> wrote:
In several applications I've developed, on the 'add' functions, insteadof using the built-in flash() function, I simply unset$this->params['data'] and display the empty form again with a successmessage, to allow for more rapid data input:
   //Save to DB and report on resultsif ($this->Enhancement->save($this->params['data'])) {$this->set('message', 'The new enhancement has been added.');unset($this->params['data']);
$this->render();}For some reason, when I upgraded to version 1.0, this stopped working.The fields won't unset, which is very confusing for users. I assumethis is because of some new pass-by-reference functionality, which I
understand is safer and better. But is there still a way to unset thefields (data) and just display an empty form and a message after thesave? When I try using the redirect() function, it doesn't get themesssage variable, and setAction() doesn't work either (times out). Any
help is greatly appreciated.-- Armando Sosawww.nolimit-studio.comwww.dospuntocero.info

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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  -~--~~~~--~~--~--~---


unset($this->params['data']) Not Working???

2006-05-18 Thread josh southern

In several applications I've developed, on the 'add' functions, instead
of using the built-in flash() function, I simply unset
$this->params['data'] and display the empty form again with a success
message, to allow for more rapid data input:

   //Save to DB and report on results
if ($this->Enhancement->save($this->params['data'])) {
$this->set('message', 'The new enhancement has been added.');
unset($this->params['data']);
$this->render();
}

For some reason, when I upgraded to version 1.0, this stopped working.
The fields won't unset, which is very confusing for users. I assume
this is because of some new pass-by-reference functionality, which I
understand is safer and better. But is there still a way to unset the
fields (data) and just display an empty form and a message after the
save? When I try using the redirect() function, it doesn't get the
messsage variable, and setAction() doesn't work either (times out). Any
help is greatly appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---