Number Control

Use textfields that only can contain numbers in your Server Behaviors Builder created Server Behaviors

Overview

When you create Server Behaviors using the SBB your options to make a User Interface are very limited. Unfortunately we can't customize how the SBB works, but we are able to customize the files generated by the SBB!

The SBB uses several standardized js files that build the different kinds of input like Recordset Menu, Recordset Field Menu etc etc. These files are called controls. There is no control file that enables you to make an input field a 'number-only' field. However, I made such a control. It enables you to use textfields in your Server Behaviors UI that may only contain numbers, and nothing else.

When you have a look at a SBB created html file (/Configuration/ServerBehaviors/ASP/) you see that it first creates some global variables (after the area where all .js links are defined):

var _myRecordsetDropDown = new RecordsetMenu("myHTMLfile.htm", "myRecordsetDropDown" ,"") etc etc The control 'new RecordsetMenu' differs for each kind of input and this is what makes the SBB created files so nice.

This is how you can use my control file:

  1. Build your SB using the SBB. in the SBB define the number-only textfield as a normal textfield
  2. Save the new control in the folder /Configuration/Shared/Controls/Scripts/
  3. Open the html file that you just generated using the SBB (it's in the /Configuration/ServerBehaviors/ folder) in dreamweaver or a text editor like Homesite.
  4. Add the following code to your html file:
  5. Find the line where your textfield is defined. It looks like 'var _myText= new TextField("mySBFile.htm", "myText", "")'
  6. Change 'new TextField(' into 'new Number('
  7. Save your file and restart Ultradev...

Easy, isn't it?

This extension is now part of the SBB Expansions Pack.

Requirements

Type: Behavior

Reviews

kj;

November 22, 2009 by Radko Radev

j;jk;

You must me logged in to write a review.