[CB 3.8] What is the standard way of passing over all the event values over to the next event

22 views
Skip to first unread message

machbox

unread,
Mar 19, 2015, 9:00:28 AM3/19/15
to col...@googlegroups.com
I have a viewlet which is some simple search HTML... some of the drop downs in this search box are populated by data.

So I have created a method in my event which populates the data into the event scope .. the view page can then consume this data from the event.

This search HTML will be used in various places throughout my application.

I have attempted doing it using persistStruct and the event structure but with no luck

Thanks guys

//Product List data set into event scope
runEvent('ProductListHandler.setProductSearchData');
                //set the view to be shown within the product list layout
                event.setView('views/specialproductlistview');
//set the next event persisting all event arguments
                setNextEvent(event='ProductListHandler.viewProductList', persistStruct=event); 

Andrew Scott

unread,
Mar 19, 2015, 10:20:19 AM3/19/15
to col...@googlegroups.com
Not sure why your using a runevent then a setview in your handler, personally I would use a model or service instead.

But your question can be answered with http://wiki.coldbox.org/wiki/FlashRam/wiki/FlashRAM.cfm

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/a67092ad-d71c-4286-858f-e5532e52b9f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Tait

unread,
Mar 19, 2015, 10:27:04 AM3/19/15
to col...@googlegroups.com
I assume you mean setProductSearchData into a service.

That would be useful since it would be easily accessible by other handlers..

however I had thought that my model should be completely platform independent so although my setProductSearchData calls a service to get the data
when it comes to putting that data into the event scope I use a Handler.

Thanks for link... will have a read through.



You received this message because you are subscribed to a topic in the Google Groups "ColdBox Platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coldbox/A6jEYaCGQbE/unsubscribe.
To unsubscribe from this group and all its topics, 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.



--
Alex Tait

Andrew Scott

unread,
Mar 19, 2015, 10:37:13 AM3/19/15
to col...@googlegroups.com
You know all events unless you make them private can be run from the URL? I am also positive that around handlers and other interceptor points can be applied to them as well. Which means you could end up making your code slower than it needs to be.


Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


Andrew Scott

unread,
Mar 19, 2015, 10:39:04 AM3/19/15
to col...@googlegroups.com
From the docs.

Executing other events (Event Chaining)

The best practice on event execution would be via the runEvent() method. However, please note that running events via this method does a complete life cycle execution. So do not abuse it. If you find that you need to chain events or are getting more complex, we suggest upgrading your code to use ColdBox Interceptors. This is a much more flexible and decoupled way of providing executing code chains.


Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


machbox

unread,
Mar 19, 2015, 10:49:40 AM3/19/15
to col...@googlegroups.com
Thanks.. yes I think Interceptors would be a much better solution.
Reply all
Reply to author
Forward
0 new messages