The "string builder" tool lets you insert references to
table fields and form controls, and insert references to grid data in
grid-style widgets. This creates dynamic forms and widgets that are driven by
application and grid widget data and the actions of the user. You can combine
static data and dynamic data elements in the string. The dynamic data elements
represent replaceable text that drives the appearance of input data. The
dynamic data is either stored in the database table or on the form.
You can also use the string builder tool to insert HTML tags. This
functionality is available in fields that contain text, such as the
Content field in the HTML/JavaScript widget, and
the
Display text field in a Text control.
Note the following points:
- If you use the string builder tool in JavaScript code in the
HTML/JavaScript widget, the code will be generated into an iframe (inline
frame). If the code is in an iframe, the widget cannot reference other parts of
the form. Therefore, the string builder tool should not be used in JavaScript
code.
- The
Treat '{' as a literal option in the string
builder tool menu is used to start typing JavaScript code. To use { as a
literal character, it must be "escaped" with a backslash (\). The
backslash is automatically added when you select this option from the string
builder tool menu.
To use the string builder tool:
- Type
{ in one of the fields that says
Type { to add a dynamic value.
- In the menu that opens, select an appropriate application variable,
control, field, endpoint, or data element.
The following examples illustrate how the string builder tool works.
- For the
Google Gadget and
Flash widgets, in the
Content field, you could type
{, select
_width, type
{, and then select
_width. This causes the content of the widget
to automatically take the value of the
Width and
Height fields in the
Size area of the Ribbon.
Note: The Google Gadget and Flash widgets are
automatically sized, so you cannot type a static value for the width and height
in the
Content field. You can type a static value
for the width and height for the Silverlight, HTML/JavaScript, and WidgetBox
widgets.
- For the Web Page widget,
URL field, you could type the URL for a social
networking site, and then type
{, select
Candidate First Name, type
+, type
{, and then select
Candidate Last Name. This creates a URL that
takes the user (for example, a hiring manager) to the Web page for that
candidate.
- For the HTML/Javascript widget,
Content field, you could type
zips={ and then select
Title.
Title is a text box on the form in which users
type their zip code to retrieve weather information.
- For the REST Grid widget,
URL field, after the endpoint portion of the
URL you could type
{, and then select an application variable
that will set the resource portion of the path. An administrator could then
override the application variable value in
SBM Composer
on a project-by-project basis. At runtime, both the endpoint and the
application variable would be resolved resulting in REST calls with different
paths for different projects.
- For the HTML/JavaScript widget,
Content field, you could type
{, and then select
#EndPointName.param to select any output parameter from an
endpoint listed in the Custom Endpoint Library, where
param could be any of the following: AuthType, ID, Password,
URL, and UserName. For example, if you are programming using the
SBM
JavaScript Library
SecureRESTServiceWrapper object, you will be able to
reference endpoint information directly in the JavaScript using the
ID parameter.
For information on
RESTServiceWrapper and
SecureRESTServiceWrapper, refer to
Querying REST Service Results.