[Colbox 3.8.1] event.paramValue not in rc.fieldnames

Just wondering if an rc value created with event.paramValue shouldn’t show up in rc.fieldnames? I’m using for things like radio buttons. Not a big deal. Just seems like they should to me. Looking at it as a difference between a default value and paraming it…




No, paraming a value will not make it show up in rc.fieldnames.

The reason is because ColdFusion creates the “form.fieldnames” variable when it processes the POST request.
Later in the request lifecycle, ColdBox takes the form and URL scopes and combines them together into a struct called “rc”.
Even later in the request, you add a new key to the rc struct via even.paramValue().
At that point, the form scope is long gone as well as any magic ColdFusion did to it.

The rc struct is not the same as the form scope, it’s just constructed in part by it, so it wouldn’t really make sense for ColdBox to go changing the value originally obtained by form.fieldNames. For all we know, you were intending to param a values from the URL scope!

I would suggest you create your own hidden form field of all possible form elements or just some list manipulation in a helper function to add it yourself after paramming it.



ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks! Makes sense. I didn’t think about where it originated from.

Thanks again.