# TabPanel add Solutionmodel Form

**URL:** <https://forum.servoy.com/t/tabpanel-add-solutionmodel-form/11947>\
**Category:** Classic Servoy\
**Created:** [March 24, 2010, 2:21pm UTC](https://forum.servoy.com/t/tabpanel-add-solutionmodel-form/11947 "2010-03-24T14:21:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janssenjos](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Janssenjos](https://forum.servoy.com/u/Janssenjos)\
**Post date:** [March 24, 2010, 2:21pm UTC](https://forum.servoy.com/t/tabpanel-add-solutionmodel-form/11947/1 "2010-03-24T14:21:28Z")

</div>

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:]( "Evil or Very Mad")

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

```auto
//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.

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [March 24, 2010, 2:32pm UTC](https://forum.servoy.com/t/tabpanel-add-solutionmodel-form/11947/2 "2010-03-24T14:32:10Z")

</div>

```auto
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

---

<div class="post-metadata">

**Author:** ![Janssenjos](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Janssenjos](https://forum.servoy.com/u/Janssenjos)\
**Post date:** [March 24, 2010, 2:41pm UTC](https://forum.servoy.com/t/tabpanel-add-solutionmodel-form/11947/3 "2010-03-24T14:41:14Z")

</div>

Thanks!

That was the problem ![:D]( "Very Happy")
