I have a very trivial application that I am working on right now. It has one form. Upon submission of the form, it gathers information from a few different APIs, and builds an ordered collection of results. It has another component that displays the results of this component. I only want this component to be visible when there are results from the form submission. How would I plumb up the the results component to render only when there are results from the form submission? The form throws the values from the form into session. Is it bad practice for the results component just to watch the session, and if there is some information there, gather the results and render itself? Is it bad practice to use the session as a sort of “Brain” for the application, in the same way we might use services in Angular? Thanks! ---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Does the first component still display along with the results? (to allow the user to change values)
If so, you can just store the second component in an instance variable of the first component. Maybe store the results as an instance variable of the second component. The first component can collect the results and set them in the second component. That way the second component can choose if it has to display anything based on its results instance variable. I’m sure some people will say it’s bad practise to use the session as a dumping ground for non-session related data. There are, of course, so many ways of doing this. It’s just what makes sense for your application. Cheers, J
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
the form would moved somewhere completely different when the results are rendered… i don’t think a parent child configuration would work.. On January 23, 2019 at 10:17:10 PM, Jupiter Jones ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Without knowing the structure, I’d just be guessing at solutions :)
There’s no reason you can’t use the session. Perhaps an “application” object accessible from the session? It can house all your application logic. Maybe that would work as a kind of “brain” for your app. Cheers, J
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Thanks! This is exactly what I ended up doing.. the session points to a brain object that holds the data. As most of the information is generated from the brain data, the brain data itself if just a few strings. On January 23, 2019 at 11:25:56 PM, Jupiter Jones ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |