newTextField label

I am creating a form and placing it in LOCKED_TABLE_VIEW mode. On that form I create several text fields from an array. Here’s the code:

_jsForm = solutionModel.newForm(_jsFrm_registerName,_jsFrm_databaseSelected,tableSelected,_jsFrm_styleName,_jsFrm_show_in_menu,_jsFrm_width,_jsFrm_height);
var _jsBody = _jsForm.getBodyPart();
_jsForm.navigator = SM_DEFAULTS.NONE; // Turn off the navigator
_jsForm.view = JSForm.LOCKED_TABLE_VIEW; // Set form to table view mode
for(var c=0; c<_jsFrm_columns.length; c++){
_jsFld_y=c*30;
_jsForm.newTextField(_jsFrm_columns[c],100,_jsFld_y,100,20);
}

That all works perfect except that there is a label created at the top of the text field and I can’t figure out how to change the properties for. For instance, if column contains an ID I want the label to be shown as “ID” or if it has a users name, the label should say ‘Name’. Here’s a screenshot of what is being produced:

So, anyone know how to change those label properties?

Thanks,

Keith

If you fill the text property of the field, it will use that in the header.

Alternatively, you can create a label for each field and set the labelFor property of that label to the name of the field. Then you can style the header by styling the label.

Thank you Joas. Using the first option you mentioned I was able to get to work by setting the titleText property of _jsFld_Comp. The second option is actually what I needed though. Works great.

On another note, I am having issues with the anchoring of those columns. As you can see from the image I provided, they are not anchors to the full width of the form. Here is the code I’m trying to use located directly below the previous code I submitted but still in the for loop:

if(c == eval(_jsFrm_columns.length-1)){
	_jsFld_Comp.anchors = (SM_ANCHOR.NORTH | SM_ANCHOR.EAST);
} else {
	_jsFld_Comp.anchors = (SM_ANCHOR.NORTH | SM_ANCHOR.WEST);
}

All I’m trying to do is get the last column to stretch over to the far right hand side of the form. I’m not able to resize the columns manually for that matter either. Is there a property I have to set for that? The closest thing I could find was the printSliding property but that is not really what I’m looking for.

Thanks again,

Keith