Hello
It looked simple to me to transport some arguments from cb.quickView to the header view.
... ... #cb.quickView("_header", args=?????)#How can i drop args into _header? I tried several things, no success.
Thanks
Hello
It looked simple to me to transport some arguments from cb.quickView to the header view.
... ... #cb.quickView("_header", args=?????)#How can i drop args into _header? I tried several things, no success.
Thanks
function quickView(required view,cache=false,cacheTimeout,cacheLastAccessTimeout,cacheSuffix,module=“contentbox”,args,collection,collectionAs,prepostExempt)
Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com
I’m in trouble to setup “args”, i simply do not understand it, how to place my variable to transport.
Thanks
#cb.quickView(view = “_header”, args=???)#
The moment you start to name the arguments, every argument in the function must be named.
“args” is just a struct. You should be able to pass args like so:
#cb.quickView(view = “_header”, args= { arg1 = “value1”, arg2 = “value2” } )#
And in your view, just reference #args.arg1#, #args.arg2#, etc.
Here are the docs:
http://wiki.coldbox.org/wiki/Layouts-Views.cfm#Rendering_With_Local_Variables
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Was that for Martin’s benefit or mine Brad?
If it was me shit, I damn well know that already.
If it was Martin, I am guessing he tried that, but without naming the view first it will always error.
It was for Martin’s. I was wondering how many times someone would reply to him before actually giving him a code sample
I’m guessing based on his question marks he didn’t know what to try. He was already using named arguments correctly.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Properly?
cb.quickView("_header", args=???)#
How is that proper?
Ahh, I thought you had copied and pasted his original code again. Yes, he will need to name the “view” argument in addition to specifying args like I showed.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Yeah, I should have made that a bit clearer, that I had copied it and referred to what needed to be changed better.
Sometimes it must be hard for you to deal with my inexperience, but thank you for that.
Actually the code snippet from Brad helped me to see, that i’m on the right train.
But it throws me an error by trying this #cb.quickView("_header", args={useFoobar = “false”})#
It looks correct to me, isn’t it?
Missing argument name, when using named parameters to a function, every parameter must have a name [0:java.lang.String]
SIGH
I really had to google for “SIGH”, but you’re right ,-)
Not surprised, I don’t hear that much these days either.
You just need to put view = in front of “_header” in addition to the bits you added for args. Currently you’re mixing positional and named arguments which was what Andrew’s original message was about. Look at the full code sample I gave you.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Brad sayed “yes, he will need to name the “view” argument in addition to specifying args like I showed.”
That was the key, thank you.
#cb.quickView(view="_header", args={useFoobar=false})#
Hey, that looks a lot like the code sample I gave you
Glad you’ve got it working now. The world is your oyster!
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Works perfect including a english lesson learning “sigh” and “The world is your oyster!”. And “I usually chicken out about 115-120 mph” from a different forum.
She’s Apples…
Arcane English idioms are just one of the many services we offer here. This is one really fun part about truly being part of a world-wide community
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com