[coldbox:4064] setValue not surviving new view

I'm fairly new to ColdBox, and am having a weird problem. I've been
going through the CB docs for the last hour and haven't come up with
anything that says what I'm trying to do won't work, but I've looked
at the sample apps and it seems that this should work.

Basically, I'm doing event.setValue("whatever", "hi there") in my
handler, then right afterwards I do setNextEvent("main.home");. But
when that view loads, and I do getEventCollection(), my "whatever" key
doesn't exist.

I'm using Railo 3.1.2, but just tested it on CF9 and the result is the
same.

So the question is this... should this work? And if so, the next
question is, why isn't it? :slight_smile:

Thanks!

Rob

Rob,

You need to persist the variable either with or before the
setNextEvent() call...

so according to your example could do:
setNextEvent(event="main.home",persist="whatever"); and that should
work.

These to links may also help you out.
http://wiki.coldbox.org/wiki/FlashRAM.cfm
http://wiki.coldbox.org/wiki/EventHandlers.cfm#setNextEvent

Regards,

Adam