Mention of self layout: aSpecLayout for DynamicComposableModel
There is no mention in the book of switching the layout of a DynamicComposableModel using #layout: aLayout
Where aLayout is one of the self class someSpec.
Took me a while to figure this out and I was busy trying
self needRebuild: false. self layout: self currentSpec.
which didn't work as they always made the system pick the defaultSpec (as the SpecInterpereter does).
Thanks for the report! I thought this was clear from the text but apparently it is not. I will fix this ASAP.
@philippeback Looking at the text it's not clear to my why you did not try the code that is in the "Changing the UI layout" part of the chapter (fourth page). Can you explain your thinking process?
There is only one mention of the #layout: and it is in the tabs example with a DynamicComposableModel created on the fly. This is not my use case, I have a Model inside another one (basically, a user response model inside the larger UI. Depending on the question that I give to it, it has to adapt layout wise (show some buttons and not others, some inputs and not others, no need to add/remove widgets). Only one mention of #layout: in the text is not enough I'd say.
Um sorry but the Dynamic Spec chapter does talk about layout in different places and the example you are talking about has a note that points to that chapter. Can you have a look there and see if it addresses your need? Maybe I need to add some text to that note.
The best is that I write a part and issue a PR.
Sure, go ahead! But I would still like to understand your thought process so that I can try to abstract and if needed apply it to other parts of the book as well.