Title: Understanding Events
Thread: Understanding Events
Forum: Discussions
Conference: ColdBox
User: ronanlucio
Hello,
I am developing my first application in Coldbox, so my apologizes for
the newbie questions, but everybody starts as a newbie.
I create an Event
Handler ehLogin.
This EH has a method doLogin.
This method call another
validateUser method in the model layer.
It isn´t working and I´m having some
difficulties solving the problem.
For all I have understood, I would pass
variables between the app flow via Event.setValue(), and for all I have seen
these variables are cleared if I execute an Event.setNextEvent()
My problem is
in a code block:
<cfif objLogin.validateUser(username, password)>
<cfset setNextEvent("ehLogin.doLogin")>
<cfelse>
<cfset setNextEvent("ehLogin.dspLogin")>
</cfif>
Once it
isn´t working, I´d like to see what validateUser() is returning.
So I put it in
a variable:
<cfset validateUser = objLogin.validateUser(username,
password)>
<cfset setValue("validateUser", validateUser)>
And put it in the vwLogin.cfm:
<cfoutput>#Event.getValue("validateUser",
"")#</cfoutput>
and it is always blank.
1) What´s wrong?
2)
How can I transport a variable in the EH to the view after a setNextEvent?
Thanks,
Ronan