IE vs. Firefox

I have a logon panel presenting input fields for user name and password. The is also a section stack entitled ‘Change Your Password’ which drops to reveal a new password and a confirm password inputs. The last control is an button. I want the section to initially be unexpanded with the button immediately following the section stack. When the section stack is expanded, I want the button to immediately follow the confirm password input box. I handled this by changing the top value of the VLayout containing the button to be one value when unexpanded and another when expanded (see sectionHeaderClick function)

This code works great with FF but in IE the VLayout top position is that of the expanded sction not the unexpanded. Note that I am invoking sectionHeaderClick on load. In both browsers, the header expanded property is initially false, as expected.

Thanks for your help.

var makeLogon = function() {
	
	isc.Label.create({
	    wrap:false,
	    title:"Enter your login information:",
	    border:"0",
	    autoDraw:true,
	    width:300,
	    contents:"Enter your login information:",
	    styleName:"headerItem",
	    ID:"Label0",
	    height:20
	})
	
	
	
	isc.LayoutSpacer.create({
	    autoDraw:false,
	    ID:"LayoutSpacer0",
	    height:20
	})
	
	isc.DynamicForm.create({
	    fields:[
	        {
	            titleOrientation:"top",
	            name:"userName",
				required:true,
	            width:150,
	            ID:"userName",
				defaultValue: "bubba",
	            title:"Operator ID",
	            showTitle:true,
				required: true,
	            _constructor:"TextItem"
	        },
	        {
	            titleOrientation:"top",
	            name:"password",
	            startRow:true,
	            title:"Password",
				defaultValue: "demo",
				ID:"password",
				required: true,
	            _constructor:"PasswordItem"
	        }
	    ],
	    autoDraw:true,
	    width:300,
		
	    ID:"DynamicForm0"
	})
	
	isc.DynamicForm.create({
	    fields:[
	        {
	            id:"newPassword",
	            titleOrientation:"top",
	            name:"newPassword",
	            width:140,
	            title:"New Password",
	            showTitle:true,
	            _constructor:"PasswordItem"
	        },
	        {
	            titleOrientation:"top",
	            name:"confirmPassword",
				ID:"confirmPassword",
				validators: {
					type: "matchesField",
					otherField: "newPassword",
					errorMessage: "Passwords do not match"
				},
	            startRow:true,
	            width:140,
	            title:"Confirm Password",
	            _constructor:"PasswordItem"
	        }
	    ],
		
	    autoDraw:false,
	    ID:"DynamicForm2"
	})
	
	
	
	isc.SectionStack.create({
	    animateSections:false,
	    visibilityMode:"multiple",
	    sections:[
	        {
	            click:"sectionHeaderClick()",
	            autoShow:true,
	            title:"Change Password",
	            items:[
	                DynamicForm2
	            ],
	            expanded:false,
	            ID:"changePasswordHeader"
	        }
	    ],
	    animateMembers:false,
	    top:100,
	    layoutAlign:"center",
	    left:233,
	    autoDraw:true,
	    width:300,
	    ID:"SectionStack4"
	})
	
	
	 
	isc.Button.create({
	    click:"logInClick()",
	    mouseUp:null,
	    title:"Log In",
	    align:"center",
	    top:0,
	    left:245,
	    autoDraw:false,
	    width:50,
	    styleName:"formCell",
	    ID:"LogIn"
	})
	
	
	
	isc.VLayout.create({
	    members:[
	        LogIn
	    ],
	    animateMembers:false,
	    top:150,
	    layoutAlign:"center",
	    left:240,
	    autoDraw:false,
	    width:300,
	    ID:"VLayoutLogIn",
		parentElement: "DynamicForm2",
	    height:20
	})
	
	isc.VLayout.create({
	    members:[
	        Label0,
	        LayoutSpacer0,
	        DynamicForm0,
	        SectionStack4,
	        VLayoutLogIn
	    ], 
	    defaultLayoutAlign:"center",
	    top:200,
	    layoutAlign:"center",
	    autoDraw:true,
	    overflow:"hidden",
	    visibility:"inherit",
	    width:"100%",
	    ID:"VLayout2",
	    height:250
	})


	DataSources.makeDataSources();
	sectionHeaderClick();


};

function logInClick()
{ 
	var password = DynamicForm0.getField("password").getValue();
	var userName = DynamicForm0.getField("userName").getValue();
	var newPassword = DynamicForm2.getField("newPassword").getValue();
	var confirmPassword = DynamicForm2.getField("confirmPassword").getValue();
	DataSources.getLoginDS().addParams( 'test', '0' );
	DataSources.getLoginDS().addParams( 'userName', userName );
	DataSources.getLoginDS().addParams( 'password', password );
	
	DataSources.getLoginDS().updateData( );
}

function sectionHeaderClick()
{
	var myHeader = SectionStack4.getSectionHeader("changePasswordHeader"); 
	if(myHeader.expanded)
	{
		VLayoutLogIn.setTop(230);
	}
	else
	{
		VLayoutLogIn.setTop(150);
	}
}

All you really need to do for this is put the button after the SectionStack in a Layout, after first making the SectionStack overflow:“visible” so that it takes up only the space it needs. See the modified code below but note I removed parts that were crashing in order to make it runnable on its own.

Note: don’t try to setTop() or otherwise change left/top coordinates of a component whose position is being managed by a Layout.

var makeLogon = function() {
	
	isc.Label.create({
	    wrap:false,
	    title:"Enter your login information:",
	    border:"0",
	    autoDraw:true,
	    width:300,
	    contents:"Enter your login information:",
	    styleName:"headerItem",
	    ID:"Label0",
	    height:20
	})
	
	
	
	isc.LayoutSpacer.create({
	    autoDraw:false,
	    ID:"LayoutSpacer0",
	    height:20
	})
	
	isc.DynamicForm.create({
	    fields:[
	        {
	            titleOrientation:"top",
	            name:"userName",
				required:true,
	            width:150,
	            ID:"userName",
				defaultValue: "bubba",
	            title:"Operator ID",
	            showTitle:true,
				required: true,
	            _constructor:"TextItem"
	        },
	        {
	            titleOrientation:"top",
	            name:"password",
	            startRow:true,
	            title:"Password",
				defaultValue: "demo",
				ID:"password",
				required: true,
	            _constructor:"PasswordItem"
	        }
	    ],
	    autoDraw:true,
	    width:300,
		
	    ID:"DynamicForm0"
	})
	
	isc.DynamicForm.create({
	    fields:[
	        {
	            id:"newPassword",
	            titleOrientation:"top",
	            name:"newPassword",
	            width:140,
	            title:"New Password",
	            showTitle:true,
	            _constructor:"PasswordItem"
	        },
	        {
	            titleOrientation:"top",
	            name:"confirmPassword",
				ID:"confirmPassword",
				validators: {
					type: "matchesField",
					otherField: "newPassword",
					errorMessage: "Passwords do not match"
				},
	            startRow:true,
	            width:140,
	            title:"Confirm Password",
	            _constructor:"PasswordItem"
	        }
	    ],
		
	    autoDraw:false,
	    ID:"DynamicForm2"
	})
	
	
	
	isc.SectionStack.create({
	    animateSections:false,
	    visibilityMode:"multiple",
            overflow:"visible",
	    sections:[
	        {
	            autoShow:true,
	            title:"Change Password",
	            items:[
	                DynamicForm2
	            ],
	            expanded:false,
	            ID:"changePasswordHeader"
	        }
	    ],
	    animateMembers:false,
	    top:100,
	    layoutAlign:"center",
	    left:233,
	    autoDraw:true,
	    width:300,
	    ID:"SectionStack4"
	})
	
	
	 
	isc.Button.create({
	    click:"logInClick()",
	    mouseUp:null,
	    title:"Log In",
	    align:"center",
	    top:0,
	    left:245,
	    autoDraw:false,
	    width:50,
	    styleName:"formCell",
	    ID:"LogIn"
	})
	
	
	
	isc.VLayout.create({
	    members:[
	        LogIn
	    ],
	    animateMembers:false,
	    top:150,
	    layoutAlign:"center",
	    left:240,
	    autoDraw:false,
	    width:300,
	    ID:"VLayoutLogIn",
		parentElement: "DynamicForm2",
	    height:20
	})
	
	isc.VLayout.create({
	    members:[
	        Label0,
	        LayoutSpacer0,
	        DynamicForm0,
	        SectionStack4,
	        VLayoutLogIn
	    ], 
            backgroundColor:"cyan",
	    defaultLayoutAlign:"center",
	    top:200,
	    layoutAlign:"center",
	    autoDraw:true,
	    visibility:"inherit",
	    width:"100%",
	    ID:"VLayout2"
	})


};