Sunday 19 October 2014

Declaring Seaside sub-components in the #children method

People often ask why they need to define the #children method on Seaside components. I wrote a long email today to the mailing list explaining how #children is currently used and why it's important and I thought it might be useful to post it here as well so it's easier to find and link to. 

When you render a child component you are implicitly defining a tree of components. #children simply allows the framework to walk the component tree explicitly. The reasons for needing to walk the tree explicitly have changed over time, which is part of the reason for the confusion.

At one point, for example, we used to walk the tree to give each component a chance to handle callbacks, so if your component wasn't in #children it would never even have seen its callbacks. That is no longer the case (which is actually a bit of a shame because decorations can no longer intercept them, but I digress).

If you look in the image for users of WAVisiblePresenterGuide and WAAllPresenterGuide, you will see the current cases where we need to traverse the tree:
  1. Calling #updateStates: for snapshotting/backtracking
  2. Calling #initialRequest: when a new session is started
  3. Executing tasks (they need to execute outside of the render phase to make sure the render phase does not have side effects)
  4. Calling #updateRoot:
  5. Calling #updateUrl:
  6. Displaying Halos for each component in development mode
  7. Generating the navigation path in WATree
  8. Detecting which components are visible/active to support delegation (#call:/#show:)
Keep in mind that basically all these things happen before rendering, so if you create new components inside #renderContentOn: they'll miss out: you should try to create your sub-components either when your component is initialized or during a callback. If your child component doesn't rely on any of the above (and doesn't use any child components itself that rely on any of these things) then technically everything will work fine without adding it to #children. But keep in mind that:
  • the framework may change in the future to traverse the tree for other reasons;
  • add-ons may depend on being able to walk the tree for other reasons; and
  • it's not great encapsulation to assume that, in the future, components you are rendering will never need any of the above nor start using sub-components that do. 
Finally, components are stateful by definition, so if you don't feel the need to persist your component between render phases, it probably shouldn't be a component. For stateless rendering you're better to subclass WAPainter directly or even WABrush: both of these are intended to be used and then thrown away and they will make it clearer in your mind whether or not you're using on things that depend on #children.

83 comments:

Willie Aames said...

I feel that with each new frontend framework, the amount of javascript code is increasing and increasing, to the point that, if I have a medium to large-sized application, my (pipelined) application.js may have a few hundreds of KBs. I'm now starting a new app using React, and with only a single CRUD it already has over 200 lines of React code defining some components. Should I only require these component files, and also any other javascript file that's not global, on the specific pages such as purevpn review where they are being used?

Anonymous said...

Informative article. A virtual private network, or just VPN, helps encrypt and secure your router against information theft, misuse and only fraud. A single DDWRT router VPN can protect traffic that is internet most of the networked computers, hence helping you save a huge expense for internet security and privacy. Furthermore, Purevpn will redress individual IPs also of every computer or device on the community, therefore helping you secure identities of computer on the World Wide Web. www.thevpnlab.com/reviews/purevpn-review

Zubair Hussain Khan said...

Hey Willie, you have shared an excellent review of PureVPN, I am a VPN user for 5 to 6 month I mostly use VPN to access geo-restricted content in the UK. Recently I bought Nord VPN, and it is fantastic.

georgperry said...

I feel that with each new frontend structure, the measure of javascript code is expanding and expanding, to the point that, in the event that I have a medium to huge estimated application, my (pipelined) application.js may have a couple of several KBs. I'm currently beginning another application utilizing React, and with just a solitary CRUD it as of now has more than 200 lines of React code characterizing a few segments. Would it be a good idea for me to just require these segment documents, and furthermore some other javascript record that is not worldwide, on the particular pages, for example, purevpn survey where they are being utilized?
Uk writing experts

Shern1933 said...

Do you find writing to be a difficult task? Have you procrastinated until the final month to write your dissertation? You do not have to panic just yet! With the assistance of British Dissertation Home, you can avail the dissertation writing services uk to get your dissertation written on any topic before the due date.

Steve Dalton said...

Do you find writing to be a tough undertaking? Have you procrastinated until the final month to jot down your dissertation? You should no longer panic simply yet! With the help of British Dissertation Home, you may avail the Quality Essay Writing Service UK to get your dissertation written on any subject matter earlier than the due date.

TECH FIRE said...

Many commentators were recommended purevpn, but make sure you have reviewed every vpns app before jump into conclusion. Check the detailed guide:
https://www.bestvpn.co/

Amy Wong said...

Damn so cool just yesterday found this site and today I know what's what good best online casino sites Now plans to sit here all your free time and fun and productive

Herryjony said...

Tracy Isselhardt
Technology can often have its own disadvantages: vulnerability to cyber threats and of course hackers is definitely one of them. This has begun to apply to car technologies as well. Vehicle security is crucial and car companies want to ensure that hackers are kept away from their customers

assignment help said...

Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such a blog. assignment helps

petterson said...

I like your post seaside for children but I think it can be very dangerous for small children
buy dissertation online

Amanda said...

It's dependably scrambling and focal. it's an astoundingly cool blog. Interfacing is a particularly head thing. You have genuinely helped stores of people who visit the blog and give them goliath information. Respects my crm system

https://assignmenthelps.org/literature-review-writing said...

Surprising article. Intriguing to examine. I really love to scrutinize such a better than average article. Thankful! keep shaking .my crm system

https://assignmenthelps.org/literature-review-writing said...

Surprising article. Fascinating to scrutinize. I genuinely love to examine such a nice article. Thankful! keep shaking .my crm system

Isabell Kiral said...

You shared a detailed post about coffee and cake. Some experts think that coffee is injurious to health and it can harm children's health but some people consider it the resource of getting refreshment. What is your opinion on this topic? Coursework writing services.

dissertation helps said...

Howdy this is overwhelming Blog… Thanks for sharing the blog.Provide the endeavor and experience a wide level of structure has any sort of impact other than please visit our page.dissertation helps

Amanda said...

I read your blog zone and this is stupefying web diary a zone.. a dedication of gratefulness is with or without together for putting the push to suit us. have a shocking day math assignments

Isabell Kiral said...

Some people think that coffee is very useful for our health and some people think that coffee is injurious to our health. What is your opinion about this topic? Assignment writing services.

Amanda said...

Astonishing post, you conferred to us. Here, perusers can get data about condition. Such kind of posts can construct our general data and limit. Thankful for sharing this respectable post. statistical analysis

Amanda said...

Disarranging post. I was paying shocking character to and on this post and I am mixed! Obliging information. statistical analysis

Amanda said...

it is a general epic site I take in various things from the site you posted scattering articals so I what's truly expected to post a general stunning article my site statistical analysis

Amanda said...

I read your blog zone and this is surprising web journal a zone.. a responsibility of thankfulness is with or without together for putting the push to suit us. have a surprising day statistical analysis

Amanda said...

it is a general epic site I take in different things from the site you posted dissipating articals so I what's genuinely expected to post a general shocking article my site statistical analysis

Amanda said...

It's astoundingly stunning article for me or every one considering the course that bit of room beginning at now need to done various information that is the explanation it's from a general perspective scrambling for me.statistical analysis

Isabell Kiral said...

A great post especially for children's health. Through this post, we can improve our children's health. Those people who are worried about their children's health, they can get knowledge from this post, and they can improve their children's health. Dissertation writing service.

Anna Stephen said...

Greatly not puzzling subtleties gave by you. I am certain it would stimulate changing English understudies. Thankful to you for setting aside some push to made such a post for us. Continue blogging. someone you loved lyrics

Anna Stephen said...

Faltering! indisputably I have found something dazzling, This is what I was checking for quite a while. Appreciative to you for offering this information to us. Keep sharing new posts. killer queen lyrics

Anna Stephen said...

Affecting! Such a pulling in and obliging post this is. I super love it. It's so overpowering everything considered impacting. I am on a perpetually central level mixed. killer queen lyrics

Andy Sunak said...
This comment has been removed by the author.
Data Science said...

Great article with excellent content found very useful thank you waiting for next blog update.
Data Analytics Course Online

Isabell Kiral said...

This is very important content because through this, we can improve our children's health. Children are very important to us, and we should take care of our children's health. Dissertation writing service.

Best E-Learning marketplace App Solution said...

I am really very happy to visit your blog. Now I am found which I actually want. I check your blog every day and try to learn something from your blog. Please keep us up to date like this. Thanks for sharing.
Also, we are giving 100% support after delivering the project. If you have any requirements regarding Blockchain, Iot, Ai, Travel Portal Development then you can contact us at +1 (415) 890 8990, +91 9500 069 296.

360DigiTMGNoida said...

Your content is very unique and understandable useful for the readers keep update more article like this.
data science course noida

vé máy bay từ Nhật Bản về Việt Nam said...

Mua vé máy bay tại Aivivu, tham khảo

vé máy bay đi Mỹ tháng nào rẻ nhất

vé máy bay từ mỹ về việt nam hãng eva

vé hà nội đà nẵng

vé máy bay pleiku đi hà nội

vé máy bay nội bài nha trang

Rahim Ladhani said...

I really Like your post. Really appreciate the research you did for this post, and I can't wait to read your next post. Here are some pros of cloning development.

bes unn said...


Nice post. I used to be checking constantly this blog and I am impressed! Extremely useful info particularly the ultimate section 🙂 I take care of such information a lot. I was seeking this certain information for a long time. Thank you and best of luck.
why is physical education important essay

training institute said...

I see some amazingly important and kept up to length of your strength searching for in your on the site
data scientist course

ol said...

t is a very interesting topic. I think that when you read informative blog you gain new knowledge and it develops our mind.Dissertation Writing Service

visa extension India said...

Thanks for sharing excellent information....You can get info about online visa extension india and India has this provides an easy to use method to apply for an Indian visa extension (frro visa extension) through a simple online application form.

emergency visa to India from USA said...

Great articles are really informative and innovative: with new updates. Thank you... You can get a visa within 1 to 3 working days by filling out the emergency visa to India from USA , attaching the correct documents and making the payment.

traininginstitute said...

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.
data scientist certification malaysia


kiran fatima said...

Pro Academic Help brings you the best prices for Academic writing UK while providing you dissertations of the highest quality

traininginstitute said...

This is very useful post for me. This will absolutely going to help me in my project.
full stack web development course in malaysia

India self declaration form said...

I thought I was familiar with this blog, but after checking through some of the posts, I realized it's actually a brand new one to me. Anyway, I am definitely glad I found it and I will bookmark it and come back often. All passengers will have to fill the air India self declaration form on arrival via India evias portal. It's too easy & Secure.

India self declaration form said...

After looking through some of the posts I realized it was a new blog for me. Anyhow, I am delighted I found it and will return soon. All passengers are required to fill up the air India self declaration form on arrival through the Indian evias portal. It's too easy & Secure.

PMP Course in Malaysia said...

I was just examining through the web looking for certain information and ran over your blog.It shows how well you understand this subject. Bookmarked this page, will return for extra.

PMP Training in Malaysia said...

360DigiTMG, the top-rated organisation among the most prestigious industries around the world, is an educational destination for those looking to pursue their dreams around the globe. The company is changing careers of many people through constant improvement, 360DigiTMG provides an outstanding learning experience and distinguishes itself from the pack. 360DigiTMG is a prominent global presence by offering world-class training. Its main office is in India and subsidiaries across Malaysia, USA, East Asia, Australia, Uk, Netherlands, and the Middle East.

Nick said...

You have given shared a good method to care for our children, this post has some outstanding tips. But I have been searching for basic services of internet so I can gain more knowledge about it.

Top Computer Coaching said...

BIIT is one of the Best C, C++, Java, Python,Training institute in Laxmi Nagar which is running from many years. The main specialty of this computer coaching is that you can take both online and offline classes according to your convenient. They have highly professional trainees who will clear doubt easily. To get information about timing and the courses you can freely call on 9311441524 or can visit to the center also on this address A-115 , First Floor , Near Panna Sweet, Shakarpur, Vikas Marg, Laxmi Nagar, Computer Institute, Opposite Metro Piller No. 33, Delhi, 110092

Bradley Howell said...

Thanks for the blog very nice keep going.
intel z270p chipset motherboard

Isabella Ava said...


Hello sir, thanks for the amazing post. Planning a holiday in India. Is indian e visa open ,yes India visa open you can now apply for India visa online.

Anonymous said...

When you render a child component you are implicitly defining a tree of components. Millennium Plaza Hotel Tower, Office: 1504, Sheikh Zayed Road, Dubai, United Arab Emirates.
Contact number - 045864033
For help Free Pickup & Delivery

cctv services

Edison hope said...


I definitely enjoy every little bit of it. This is a great website and good stock.I want to thank you.. We provide business consulting services where we give the services to B2B and B2C in the segment of food tech, consumer , e-learning, travel and many more.

Lio Morgan said...

A helpful article. A virtual private network, or VPN for short, assists in encrypting and protecting your router from data theft, abuse, and only fraud. A single DDWRT router VPN can secure the majority of networked machines' internet traffic, saving you a tonne of money on internet security and privacy. Additionally, Purevpn will change each computer or device's unique IP address in the network. Graphic design services

Turkey visa said...

I read your blog and found many interesting metrics in this material. Thanks for sharing it on the Internet. Person who is willing to visit Turkey can apply for a Turkey visa which is a totally online process. Fill the application form, make payment & receive it in email. As simple as that.

Turkish visa for Canadian citizens said...

Hello everyone, If you are a citizen of Canada and you are planning a trip to Turkey. Turkish visa for Canadian citizens is available online. They can apply for a Turkey visa and enjoy a trip to Turkey.

Turkey e visa said...

You are sharing a wonderful article with your audience. Readers are already enjoying it. I am here to inform the travelers who are willing to visit Turkey that they need a Turkey e visa to enter Turkey. Online process makes makes easy to get evisa.


apple watch series 3 nike 42mm said...

Thank you for the blog...Nice.

Henry Arthur said...

Great piece of information here on your website. Keep up the good work, I am really glad that I found your website and I will gladly subscribe your blog for more interesting information.
Sell Apple iPhone 13 Pro Max 512GB

sell s21 ultra said...

Thanks for the blog.your article is well written and understandable, Nice...

SOIL MODIFICATION services in USA said...

SOIL MODIFICATION services in USA involve various techniques and technologies used to enhance the properties of soil for different purposes, such as agriculture, construction, and environmental remediation. These services can help improve soil stability, fertility, and water retention, among other factors.



Essien said...

I've read some great stuff here. Will definitely bookmark and visit again. I am amazed at the effort you put into creating such an excellent and informative website. Thanks so much for sharing. abdu gusau polytechnic admission portal

electra dubai said...

It's interesting to see how the reasons for needing to walk the tree explicitly have evolved over time. Additionally, having a clear explanation of technical concepts like this can be beneficial for developers and those interested in learning more about web development. Adding information about eglo electrical lighting abu dhabiseems unrelated to this topic.

elitefence said...

Learn how to seamlessly integrate your Twitter feed onto your website or Blogger platform with the help of experiencedchain link fencing Edmontoncreating a dynamic and engaging online presence for your audience.

places to visit in Turkey other than Istanbul said...

The best places to visit in Turkey other than Istanbul. One such place is Cappadocia, renowned for its surreal rock formations and cave dwellings. Travelers can enjoy hot air balloon rides, explore ancient underground cities, and hike through breathtaking valleys. Pamukkale is another must-visit destination, featuring stunning terraces of mineral-rich thermal waters.

Car Detailing Ottawa said...

Defining the #children method provides clarity and structure to the code, allowing for efficient manipulation of child elements. Stay informed and enhance your car care knowledge with Car Detailing Ottawa, ensuring your vehicle receives the attention it deserves.

India visa application Kenya said...

You must submit an India visa application Kenya, if you are an Indian national planning a trip there. There are a few crucial phases in the application procedure for an Indian visa Kenya. Applying far enough in advance to give enough time for processing is advised. Application for an India visa Kenya is required in order to guarantee a simple and trouble-free journey.

Henry Evelyn said...

We would like to extend our sincere appreciation for your invaluable contribution, which has greatly enhanced the overall experience for everyone involved. Singapore, transit passengers, free tour, Changi Airport, restarts, 2 years. After a two-year hiatus, Singapore has recently resumed its free tour programme for transit travelers at Changi Airport. Through this programme, travelers who have a stopover in Singapore may benefit from a free city tour that gives them an overview of the sights and culture of the city. By encouraging travelers to explore Singapore during their layover and make the most of their time at the airport, the project hopes to improve the transit experience.

Ziya said...

I love this article's accurate details as well as well-written content. I got deeply involved in the information that I simply could not put it out. Your dedication and expertise have amazed me. Thank you really lot. customer relationship management module in erp

curbsidecar said...

Curbside Mobile Car Detailing Ottawaoffers exceptional services to keep your car in pristine condition. Their skilled team ensures every nook and cranny of your vehicle is thoroughly cleaned and detailed. With their convenient mobile service, you can enjoy top-quality car detailing right at your doorstep.




Ethiopia e Visa for Switzerland Citizens said...

Hello! Thanks for this useful article, expecting this text related to this taking into account once more. Ethiopia e Visa for Switzerland Citizens, explore Ethiopia hassle-free with an e-Visa! Streamlined online application process for your convenience. Embark on an unforgettable Ethiopian adventure today.

hastencatering said...

Declaring Seaside sub-components in the #children method" provides insights into efficient code structuring. In Texas, where precision is crucial in drilling rig operations, consider the parallel importance of Drilling rig catering services in Texas Just as code structure influences functionality, catering services ensure the well-being and sustenance of the workforce on drilling rigs, contributing to a seamless and efficient work environment.

Accounting writing said...

Greetings! Thank you for this valuable article, looking forward to more content related to accounting assignment. Explore Ethiopia hassle-free with an e-Visa designed for Switzerland citizens! Benefit from a streamlined online application process for your convenience and embark on an unforgettable Ethiopian adventure today with the assistance of our accounting assignment services.

Charbonnel said...

milk sea salt caramel truffles present a luxurious blend of velvety milk chocolate, smooth caramel, and a touch of sea salt, creating a decadent indulgence that captivates the palate with its sweet-savory perfection.

apply for Turkish visa online said...

Your blog post is an intellectual odyssey, each paragraph intricately stepping into uncharted territories of thought. Orchestrating a symphony of ideas, eloquence becomes a guiding force. A masterpiece transcending storytelling, leaving an indelible mark on the reader's intellectual landscape.

Julio M. Holt said...

Examining how the reasons for the explicit need to navigate the tree have evolved over time is intriguing. Moreover, offering a clear explanation of technical concepts like this can be advantageous for developers and those eager to delve deeper into Finance Assignment . However, incorporating information about Eglo Electrical Lighting in Abu Dhabi seems unrelated to this specific finance assignment topic.






eTA for Kenya said...

The core of your blog is a constant source of joy, seamlessly merging valuable insights with a concise and eloquent writing style. Your profound analysis and the ease with which you simplify complex ideas leave a lasting impression, providing readers with an engaging and enlightening experience.

Johanson said...

Blogging is a regular activity for me, and your content is something I truly appreciate. This outstanding article has caught my attention. I've decided to bookmark your site and will be checking for new details about once a week. I've also opted in for your RSS feed.Discover Best SIM Cards For Tourists In Antigua And Barbuda. Enjoy reliable connectivity, affordable data, and stay connected while exploring this beautiful Caribbean destination.

Saudi Arabia visa online official website said...

Your blog is a breath of fresh air! I'm always excited to see what new content you've shared. Your writing style is captivating, and your insights are thought-provoking. Thank you for consistently delivering high-quality content that inspires and educates.

How long does it take to get a visa for Egypt in the US? said...

Perusing your blog post felt like a serene wander through the labyrinth of human contemplation. Each word resonated with the complex interplay of our inner musings, offering glimpses into shared experiences and individual reflections. Your adeptness at encapsulating the essence of human thought is truly impressive, leaving me introspective long after I've finished reading. Gratitude for this thought-provoking journey.

Do Australians need a visa for Saudi? said...

Your blog is a treasure trove of wisdom and inspiration! I appreciate the thoughtfulness and depth evident in every article. Your ability to tackle diverse subjects with clarity and insight is truly commendable. Thank you for sharing your expertise and passion—it's a pleasure to be a reader of your blog!

william said...

In your blog post, you embark on a captivating literary journey that effortlessly traverses the realms of intellect and emotion. The seamless blend of profound insights and relatable anecdotes is truly remarkable. How do Indians get visa for Vietnam? Indian citizens can obtain an Visa for Vietnam by completing the online application process, submitting necessary documents, paying the fee, and awaiting approval. Ensure all requirements are met before applying to facilitate a smooth and timely process.

Kenya eTA Fees said...

Your website is simply superb! The content is exceptional and of the highest caliber. I'll definitely bookmark your site and subscribe to the feeds. Finding such an abundance of useful information here is wonderful. Let's collaborate on generating additional strategies. Thank you for sharing your insights! Although it takes a significant amount of time to read and comment, the rewards are substantial.