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.

94 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

haryjohn8feb said...

Excellent and nice post. It will beneficial for everyone. Thanks for sharing such a wonderful post. Avail No 1 Essay writing Services UK from certified PhD writers. It is extremely helpful for me. You can email us at info@ukdissertationhelp.co.uk or Phone Number - 020 8144 9988

Max Russell said...

Thank you for sharing this. The blog is very informative. The given blog tends to provide essential information about the changes and modifications of the Web application development company.

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

Ajay Sharma said...

Such a nice blog.
AppSquadz is known as the best app development service provider company. We have a goal-oriented developers’ team that has managed carefully and punctual to deliver project on time. Mobile App Development Company

Spss Help said...

It is a infromative and good website.Please visit spss help

my crm system said...

I adored the article, continue refreshing intriguing articles. I will be an ordinary peruser. my crm system

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...

This Is Really Great Work. Much thankfulness to You For Sharing Such A Good And Useful Information Here In The Blog math assignments

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...

"I read your blog zone and this is astonishing web diary a zone.. a commitment of gratefulness is with or without together for putting the push to suit us. have an astonishing day 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...

Howdy this is overpowering Blog… Thanks for sharing the blog.Provide the undertaking and experience a wide degree of structure has any kind of effect other than please visit our page. 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...

This is lighting up post, superb work, I like this substance and wish to inspect more from you. a commitment of appreciation is all together for such an enlightening post. someone you loved lyrics

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.
Abhi verma said...

I am very happy to read this article . Thanks for giving us Amazing info. Fantastic post. I appreciate this post. If you are interested in cryptocurrency, then Here you can know How to Earn Bitcoin and Other Cryptocurrencies

mary Brown said...

IEEE Project Domain management in software engineering is distinct from traditional project deveopment in that software projects have a unique lifecycle process that requires multiple rounds of testing, updating, and faculty feedback. A IEEE Domain project Final Year Projects for CSE system development life cycle is essentially a phased project model that defines the organizational constraints of a large-scale systems project. The methods used in a IEEE DOmain Project systems development life cycle strategy Project Centers in India provide clearly defined phases of work to plan, design, test, deploy, and maintain information systems.


This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript. JavaScript Training in Chennai JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let’s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript Training in Chennai JavaScript applications.

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.

Cyber Security Course said...

Writing in style and getting good compliments on the article is hard enough, to be honest, but you did it so calmly and with such a great feeling and got the job done. This item is owned with style and I give it a nice compliment. Better!
Cyber Security Training in Bangalore

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

Data Science Course in Bangalore said...

I was very happy to find this site. I really enjoyed reading this article today and think it might be one of the best articles I have read so far. I wanted to thank you for this excellent reading !! I really enjoy every part and have bookmarked you to see the new things you post. Well done for this excellent article. Please keep this work of the same quality.
Data Science Course in Bangalore

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

Pallavi reddy said...

i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
data scientist course in bangalore

Data Science said...

I am glad to discover this page. I have to thank you for the time I spent on this especially great reading !! I really liked each part and also bookmarked you for new information on your site.
Data Science Training in Chennai

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

Amaan said...

We are the dishwasher repairing experts in Dubai, no matter what brand or what model you have, we can easily repair your dishwasher within your given time, to make use of our service just contact us through our website.
Dishwasher Repair in Dubai

traininginstitute said...

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

traininginstitute said...

I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
data science training

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

Deekshitha said...

Informative blog
best digital marketing institute in hyderabad

Deekshitha said...

Informative blog
ai training in hyderabad

Deekshitha said...

Informative blog
cyber security course fees in ahmedabad

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

Tellali felakti umumiye said...

tiktok jeton hilesi
tiktok jeton hilesi
referans kimliği nedir
gate güvenilir mi
tiktok jeton hilesi
paribu
btcturk
bitcoin nasıl alınır
yurtdışı kargo

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.

Unknown said...

Your article is well-written and understandable even to a novice. As a result, beginners may find it incredibly useful. Thank you very much for sharing that information with us. Writers like you inspire me and I admire and respect them.
Cash for Samsung Ipad

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.

Kaylee Brown said...

Finance offers one of the highest-paying jobs in the world. It is also the reason why more and more students choose finance as their career option. The courses are so created that finance assignments typically do the assessments of students grasping the knowledge. To make it tough, the assignments are to be submitted in a timely manner. This makes the job tougher. Taking Finance Assignment Help will help you to overcome this problem.

traininginstitute said...

This is really very nice post you shared, i like the post, thanks for sharing..
cyber security course malaysia

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

Raptorz said...

İnstagram takipçi satın al! İnstagram takipçi sitesi ile takipçi satın al sende sosyal medyada fenomen olmaya bir adım at. Sende hemen instagram takipçi satın almak istiyorsan tıkla:

1- takipçi satın al

2- takipçi satın al

3- takipçi satın al

Courses said...

Just a shine from you here and have never expected anything less from you and have not disappointed me at all which i guess you will continue the quality work. Great post.
Data Science Training in Gurgaon

Training said...

I like viewing this web page which comprehend the price of delivering the excellent useful resource free of charge and truly adored reading your posting. Thank you!
Data Science Certification Course

Albert said...

Good morning everyone.. Your post more useful for all person. Thank you sir.. Many people query What is visa fee for Indian e-business? Indian e-business fee depends on your nationality and your visa duration. You can read all other information about the Indian e-business visa on our India eVisa page.

Bradley Howell said...

Thanks for the blog very nice keep going.
s10 plus screen repair

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

data science course in patna said...

It has increases the importance of the field. If you have also been attracted by the value of data science and want to learn it, you have to understand the basic courses of data science you need to learn to move successfully in the industry.
data science course in patna

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.