Solution model label: type error fro createBorder

In a solution model form I created a label and then tried to add a border

var endTitle = frmEnd.newLabel('Error!!!',20,20,420,30);
endTitle.borderType = solutionModel.createBorder(1,'#ff0000');
endTitle.fontType = solutionModel.createFont('Helvetica',1,24);
endTitle.foreground = '#ff0000';
endTitle.transparent = true;

but this generates a warning The method createBorder() is undefined for the type JSSolutionModel and, if I run the method, its crashes with a type error```
TypeError: Cannot find function createBorder in object SolutionModel. (/Users/john/Servoy 6.1/servoy_workspace/dbfa_global_service/globals.js#197)

Is this a bug or am I doing something terribly wrong?

MacOs X 10.8.2
java.version=1.6.0_35

Hi Rioba,

Like the error says the function solutionModel.createBorder() doesn’t exists.
What you want is solutionModel.createLineBorder().
Check the solutionModel node in the SolutionExplorer tree for the other border options.

Hope this helps.

Thanks for your reply, always prompt and useful. However I just copied the function from the SolutionModel/JSLabel/borderType example

var field = form.newField('my_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.borderType = solutionModel.createBorder(1,'#ff0000');

I didn’t realize there is a borderType function at SolutionModel node. So, what’s the use of the createBorder function at the JSLabel node?

Hi Rioba,

rioba:
I didn’t realize there is a borderType function at SolutionModel node. So, what’s the use of the createBorder function at the JSLabel node?

I double checked but there is no createBorder() function on any of the solutionModel classes so I am not sure where you got it from.
Anyway, the createLineBorder (and other createXXXXBorder functions) are just helper methods to produce the string that the borderType property understands.

Hope this helps.

Hi Roclasi,
the code I posted is the example generated by clicking the move sample button on the SolutionModel/JSLabel/borderType property and it is also in the Wiki page

[attachment=0]border.jpg[/attachment]

Hi Rioba,

I suggest you file a bugreport for this.
The documentation (wiki and sample code) doesn’t reflect the actual functionality.

Thanks, I will do it right away