preserveState not working?

View: New views
6 Messages — Rating Filter:   Alert me  

preserveState not working?

by jaggedaz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm running MG 2.0 Build 160 along with reactor and coldspring.  The problem
I'm having is that I can't seem to get the viewState to clear out after an
event redirect.

After my form is submitted, it fires off the commit event which has a
redirect defined that reads:

<result do="admin.article.addEdit" redirect="true" preserveState="false"
append="ArtID" />

So what I'm having it do is basically redirect back to the original form,
but reset everything so that it's ready for the next submission.  What's
happening is that all of the variables being submitted with the form are
sticking around even after the re-direct happens.  I had thought that the
preserveState="false" flag would have prevented that.  Anyone have any ideas
as to why this would be happening?
--
View this message in context: http://www.nabble.com/preserveState-not-working--tf3769443.html#a10657078
Sent from the Model-Glue mailing list archive at Nabble.com.

--^----------------------------------------------------------------
This email was sent to: lists@...

EASY UNSUBSCRIBE click here: http://topica.com/u/?b1drHn.b8CODV.bGlzdHNA
Or send an email to: modelglue-unsubscribe@...

For Topica's complete suite of email marketing solutions visit:
http://www.topica.com/?p=TEXFOOTER
--^----------------------------------------------------------------



Re: preserveState not working?

by Bryan S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Josh

You are probably going to have trouble getting help with this since you are running such an old version of Model Glue. You might want to consider updating to the newest version. Check Joe's blog for notes on some important changes you will need to make to your application.
http://www.firemoss.com/blog/index.cfm?mode=entry&entry=C40EF7D4-3048-55C9-43B89F99A0DACE98

Bryan


On 5/16/07, Josh Grauer <jaggedaz@...> wrote:

I'm running MG 2.0 Build 160 along with reactor and coldspring.


Re: preserveState not working?

by jaggedaz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Ok, I think I've fixed the problem.  First I updated Model-Glue to version
2.0.284, which I think is the latest BER to see if it would fix the issue,
and it didn't.  So I started digging through the framework files to figure
out how the redirect was being handled and found that for some reason the
preserveState argument didn't seem to be getting passed to the forward
method...  so if you look at /ModelGlue/unity/framework/ModelGlue.cfc at
line 413 you'll see this:

<cfset eventContext.forward(mapping[j].event, mapping[j].append) />

Now if you look at /ModelGlue/unity/eventrequest/EventContext.cfc you'll see
that the Forward method is expecting these arguments:

<cfargument name="event" type="string" required="true" hint="The event to
forward to.">
<cfargument name="append" type="string" required="false" hint="A list of
state values to append to the URL.">
<cfargument name="stateful" type="boolean" required="false" default="true"
hint="A list of state values to append to the URL.">
<cfargument name="anchor" type="string" required="false" hint="An anchor to
append to the URL." default="">

So it doesn't look like the preserveState (stateful) or the anchor arguments
are being passed.  To fix it I just added the argument to the method call:

<cfset eventContext.forward(mapping[j].event, mapping[j].append,
mapping[j].preserveState) />

Tested it out and it seemed to resolve the issue.  Now I'm wondering if I
should submit this to the trac site... can anyone comment on whether or not
this appears to be a valid bug?



jaggedaz wrote:

>
>
> I'm running MG 2.0 Build 160 along with reactor and coldspring.  The
> problem
> I'm having is that I can't seem to get the viewState to clear out after an
> event redirect.
>
> After my form is submitted, it fires off the commit event which has a
> redirect defined that reads:
>
> <result do="admin.article.addEdit" redirect="true" preserveState="false"
> append="ArtID" />
>
> So what I'm having it do is basically redirect back to the original form,
> but reset everything so that it's ready for the next submission.  What's
> happening is that all of the variables being submitted with the form are
> sticking around even after the re-direct happens.  I had thought that the
> preserveState="false" flag would have prevented that.  Anyone have any
> ideas
> as to why this would be happening?
> --
> View this message in context:
> http://www.nabble.com/preserveState-not-working--tf3769443.html#a10657078
> Sent from the Model-Glue mailing list archive at Nabble.com.
>
>
>
>
>

--
View this message in context: http://www.nabble.com/preserveState-not-working--tf3769454.html#a10689103
Sent from the Model-Glue mailing list archive at Nabble.com.

--^----------------------------------------------------------------
This email was sent to: lists@...

EASY UNSUBSCRIBE click here: http://topica.com/u/?b1drHn.b8CODV.bGlzdHNA
Or send an email to: modelglue-unsubscribe@...

For Topica's complete suite of email marketing solutions visit:
http://www.topica.com/?p=TEXFOOTER
--^----------------------------------------------------------------



Parent Message unknown RE: preserveState not working?

by jaggedaz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bryan -- Thanks for the link.  I took your advice and updated to version
2.0.284, which I think is the latest BER to see if it would fix the
issue, but no luck.  So I started digging through the framework files to
figure out how the redirect was being handled and found that for some
reason the preserveState argument didn't seem to be getting passed to
the forward method...  so if you look at
/ModelGlue/unity/framework/ModelGlue.cfc at line 413 you'll see this:

<cfset eventContext.forward(mapping[j].event, mapping[j].append) />

Now if you look at /ModelGlue/unity/eventrequest/EventContext.cfc you'll
see that the Forward method is expecting these arguments:

<cfargument name="event" type="string" required="true" hint="The event
to forward to.">
<cfargument name="append" type="string" required="false" hint="A list of
state values to append to the URL.">
<cfargument name="stateful" type="boolean" required="false"
default="true" hint="A list of state values to append to the URL.">
<cfargument name="anchor" type="string" required="false" hint="An anchor
to append to the URL." default="">

So it doesn't look like the preserveState (stateful) or the anchor
arguments are being passed.  To fix it I just added the argument to the
method call:

<cfset eventContext.forward(mapping[j].event, mapping[j].append,
mapping[j].preserveState) />

Tested it out and it seemed to resolve the issue.  Now I'm wondering if
I should submit this to the trac site... can anyone comment on whether
or not this appears to be a valid bug?



Bryan S wrote:

> Josh
>
> You are probably going to have trouble getting help with this since you
> are
> running such an old version of Model Glue. You might want to consider
> updating to the newest version. Check Joe's blog for notes on some
> important
> changes you will need to make to your application.
> http://www.firemoss.com/blog/index.cfm?mode=entry&entry=C40EF7D4-3048-55C9-43B89F99A0DACE98
>
>
> Bryan
>
>
> On 5/16/07, Josh Grauer <jaggedaz@...> wrote:
> >
> >
> > I'm running MG 2.0 Build 160 along with reactor and coldspring.
>

--^----------------------------------------------------------------
This email was sent to: lists@...

EASY UNSUBSCRIBE click here: http://topica.com/u/?b1drHn.b8CODV.bGlzdHNA
Or send an email to: modelglue-unsubscribe@...

For Topica's complete suite of email marketing solutions visit:
http://www.topica.com/?p=TEXFOOTER
--^----------------------------------------------------------------


Ajax.cfc + modelglue?

by Dan Criel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

I'm trying to find an easy way to make AJAX calls in Model Glue.  We use
Ajax.cfc in all of our non model glue applications and I was wondering
how to get it to work with Model Glue.

Any help would be greatly appreciated, as always!

Thanks,
Dan

--^----------------------------------------------------------------
This email was sent to: lists@...

EASY UNSUBSCRIBE click here: http://topica.com/u/?b1drHn.b8CODV.bGlzdHNA
Or send an email to: modelglue-unsubscribe@...

For Topica's complete suite of email marketing solutions visit:
http://www.topica.com/?p=TEXFOOTER
--^----------------------------------------------------------------


Re: Ajax.cfc + modelglue?

by Dan Wilson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dan,

There is a ModelGlue example in the ajax.cfc example files.  Have you looked into that?


The example was written against ModelGlue 1 so you can refactor it for ModelGlue:Unity by putting ajax.cfc inside ColdSpring.



Dan Wilson





On 7/5/07, Dan Criel <dcriel@...> wrote:
Hello all,

I'm trying to find an easy way to make AJAX calls in Model Glue.  We use
Ajax.cfc in all of our non model glue applications and I was wondering
how to get it to work with Model Glue.

Any help would be greatly appreciated, as always!

Guillaume Apollinaire quotes