Recalculate width of Layout

Hello,

I have the following Problem: A VerticalLayout (parent) is nested within a VerticalLayout (child). setMargin and setSpacing are set to “true” for both layouts. The child has a width of 100%. Certain user-interactions cause the parent element to get another CSS-style, that has a margin defined.

The initial parent style looks like this:


.ifthenbox_binding_container_no_conditions {
}

.ifthenbox_binding_container_no_conditions .v-verticallayout-margin-left   {padding-left:   0px; }
.ifthenbox_binding_container_no_conditions .v-verticallayout-margin-right  {padding-right:  0px; }
.ifthenbox_binding_container_no_conditions .v-verticallayout-margin-top    {padding-top:    0px; }
.ifthenbox_binding_container_no_conditions .v-verticallayout-margin-bottom {padding-bottom: 0px; }
.ifthenbox_binding_container_no_conditions .v-verticallayout-spacing-on {
	padding: 0px;
}

After some user interaction the parent gets the following style set and its initial style removed:


.ifthenbox_binding_container_has_conditions {
	background: #d3dbe2 !important;
	border:     1px solid #919191;	
}

.ifthenbox_binding_container_has_conditions .v-verticallayout-margin-left   {padding-left:   10px; }
.ifthenbox_binding_container_has_conditions .v-verticallayout-margin-right  {padding-right:   0px; }
.ifthenbox_binding_container_has_conditions .v-verticallayout-margin-top    {padding-top:    10px; }
.ifthenbox_binding_container_has_conditions .v-verticallayout-margin-bottom {padding-bottom: 10px; }
.ifthenbox_binding_container_has_conditions .v-verticallayout-spacing-on {
	padding-top:     0px;	
	padding-left:    0px;
	padding-bottom:  0px;	
	padding-right:   0px;		
}

After changing the style, the child element gets shifted to the right, which is the desired behaviour (see padding-left: 10px; in the according style). However, it keeps its original width, thus it pokes out of the parent element. When I inspect the DOM-tree, all styles are set correctly, only the width is not correct. Is there a way to force a revalidation of the DOM-tree, so that the width of the child element is recomputed?

Thanks in advance,
kind regards,
-Albert