component {
function home(event, rc, prc) {
event.setView("viewlets/home");
}
function userinfo(event, rc, prc) {
prc.data.username = "jsmith";
return renderView("viewlets/userinfo");
}
}
<cfoutput>#runEvent("viewlets.userinfo")#</cfoutput>
<cfoutput>
<div>Username: #prc.data.username#</div>
</cfoutput>
<html>
<head></head>
<body>
<div>I am Layout.</div>
<div><cfoutput>#renderView()#</cfoutput></div>
</body>
</html>
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
component {
function index(event, rc, prc) {
prc.message = "Welcome!";
}
}
component {
function userinfo(event, rc, prc) {
prc.username = "jsmith";
return renderView(view="viewlets/userinfo");
}
}
I am main.index view. <cfoutput>#prc.message#</cfoutput>
Your username is <cfoutput>#prc.username#</cfoutput>.
<html>
<head>
<title>main layout</title>
</head>
<body>
<cfoutput>
<div>#renderView()#</div>
<div>#runEvent("viewlets.userinfo")#</div>
</cfoutput>
</body>
</html>
Andrew, thanks for answering my questions and giving some advanced techniques. Would you mind take a look viewlets description on http://wiki.coldbox.org/wiki/Layouts-Views.cfm#Viewlets_(Portable_Events)? It seems pretty straight forward, but I couldn't make the sample code work as I posted on https://groups.google.com/d/msg/coldbox/fow9lYo_cM4/Hp7Dld2Rn1EJ. Thanks again!
--
I am running ColdBox 3.8.1 on Railo 4.2.1.Would you make your solution on https://groups.google.com/d/msg/coldbox/fow9lYo_cM4/jYpRDPGYD7EJ a bit clear? The wrapper looks like a recursive to me. :)
--
--------- Original Message ---------
--
--------- Original Message ---------
--