[Seaside] Conditionally loading/displaying a component

Jupiter Jones jupiter.jones at mail.com
Thu Jan 24 03:16:58 UTC 2019


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

> On 24 Jan 2019, at 12:37 am, sergio ruiz <sergio.rrd at gmail.com> wrote:
> 
> 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 <http://bit.ly/29z9fG0>
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com <http://www.codeandmusic.com/>
> http://www.twitter.com/sergio_101 <http://www.twitter.com/sergio_101>
> http://www.facebook.com/sergio101 <http://www.facebook.com/sergio101>_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org <mailto:seaside at lists.squeakfoundation.org>
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20190124/8a36fa59/attachment.html>


More information about the seaside mailing list