Adjust scrollview to the size of the inner components

Hello,
I have a scrollview that contains a set of toolbar followed by a template, something like this:

scrollview{
toolbar
template
toolbar
template
toolbar
template
...
...
}

untill here everything works fine, but when I try to change and resize the templates I do the following:

$$(templateID).define('template', data);
$$(templateID).define('height', 100);
$$(templateID).resize();
$$(templateID).render();
$$(scrollviewID).adjust();
$$(scrollviewID).resize();

in this case the scroll view is not resized so some component I need to show is not showed. When I rotate the the device the scroll view is correctly resized so I can see all the componentes.
Why I get this behavior?

Thanks for your help
Danilo

Hello,

please try to use attached libraries. Some issues with resize were fixed there
codebase.zip (168 KB)