Being a newbie sucks

As you saw by the subject of this email please know I am brand new to coldbox, I have searched the wiki and think a little guidance will go a long way. I am attempting to build a small system, just adding, updating and removing database records.

The problem I am running into is that the RC, event and PRC do not seem to be available to my models? Is that right?

Any help is appreciated!

Here is the code I am using

View: this submits to a handler called account/profileUpdate

Handler: (filename = accou****nt.cfc)

<cfset this.tmp = getmodel(“Account”).ProfileUpdate(rc)>

<cfset event.setView(“accountDetails”)>

Model: (filename = account.cfc)

update TABLE set

cFname = ,

cLname =

where VendorID =

You are explicitly passing the RC, so, yeah, it’s available in your object.

  • Are you getting an error? If so, post it.
  • What behavior are you seeing that you don’t expect to see?
  • What behavior are you NOT seeing that you do expect to see?
  • What version of ColdBox?
  • What CFML engine (and version)?

Folks are going to need a lot more info before they can provide much assistance. Welcome to the group. :slight_smile:

In your model ProfileUpdate function do a:

<cfdump var="#arguments#'><cfabort>

This will tell you what you have in your models function available for usage.

I always use the scope of my var to avoid issues. For example:

value="#rc.cLname#" should be value="#ARGUMENTS.rc.cLname#"

get bit by scoping a few times and you will also.

That is correct, the event and RC and PRC are passed into handlers and interception points mainly, But that doesn’t mean you can’t use them.

function myModel(event, rc, prc) {}

However you need to remember that a model is like a black box, it shouldn’t care about anything outside of it and should only care about what is being passed and returned.

Thanks for the quick replies and suggestions. They did the trick!

Thanks!

Your welcome.