TabPanel add Solutionmodel Form

Hi all,

Having troubles to add a form, created with the solutionmodel, to an existing tabpanel. I keep getting false from the addTab method :evil:

Hope someone can tell me what I’m doing wrong:

//Clear current forms from tab	
elements.tabParams.removeAllTabs();

var _formName = "paramForm";
var _form= solutionModel.getForm(_formName) ;

//If the form doesn't exist yet, create form
if(_form  == null)
{		
	_form = solutionModel.newForm(_formName,"data",[],'Default',false,450,280);
	
	//Get foundset of all parameters for this step	
	var paramFoundset = databaseManager.getFoundSet("data","Steps");

	if(paramFoundset.find())
	{
		paramFoundset.StepId= localStepId;
		paramFoundset.search();			
	}

	//Now create a textbox for each step.
	for(var i = 1; i <= paramFoundset.getSize();i++)
	{
		var _param = paramFoundset.getRecord(i);			
			
		var jsvar = _form.newFormVariable("param_"+_param.id,JSVariable.TEXT);
		var lb = _form.newLabel(_param.name,15,i*25,80,20);
		var tf = _form.newTextField("param_"+_param.id ,15,i*25,140,20);
	}		
}	

//Add the form to the tabpanel
//Success is false everytime.
var success = elements.tabParams.addTab(_form, 'Test', null, null, null, null, null);
	
application.output('Form successfully added to the tab: ' + success);

Thanks.

var success = elements.tabParams.addTab(_form, 'Test', null, null, null, null, null);

The _form variable in the above code snipplet is a JSForm, so a solutionModel representation of a form, not the runtime representation of the form. Try adding forms[_formName]

Paul

Thanks!

That was the problem :D