Siebel Advisor API Reference > Pageset Functions for Siebel Advisor >
BuildTarget
Usage
Use the BuildTarget function on a display page to create output target controls that display links, images, or text in response to a user selection. You call the BuildTarget function in the <BODY> section of a display page. Also, all BuildTarget calls must be inside the <FORM> section of the HTML source of display pages. The function is usually called from within a JavaScript document.write method. Syntax
BuildTarget(type,window,name[,arg1,arg2])
|
|
type |
Specifies the type of output target control to create. Valid control types are:
|
name |
Defines the source of the content that populates the output target, which can be any of the following:
- A column in a Configuration table. In this case, the argument is simply the name of the column.
- A column in a Feature table. In this case, the argument is the name of the Feature table and the name of the specific column inside of it, separated by a period, as in COLOR.DESC.
- The Feature table used to populate an input UI control from which the user has made a selection. In this case, the argument is simply the name of the Feature table.
- The name of a text entry input UI control in which text is typed and stored. In this case, the argument is the name you used to define the text entry input UI control.
For syntax, see Content Sources for Output Targets. |
arg1, arg2 |
Some output target types take additional arguments. |
Link Output Targets
Set the type argument for the BuildTarget function to LINK to create a link output target. The table column specified by the name argument can contain pageset IDs or URLs. The isPage argument defines how the data is handled. The dynDefCol argument points to a column that contains information that dynamically overrides the defaults of the specified pageset. The syntax used to create a link output target is: BuildTarget("LINK",window,name,isPage[,dynDefCol])
|
|
name |
Column in a Configuration table or Feature table that contains pageset IDs or URLs. |
isPage |
This optional argument is a Boolean value that determines whether data in the column identified by the name argument is a pageset (TRUE) or a URL (FALSE). If the data is a URL and you set the argument to FALSE, the URL loads into a separate window, instead of inside the main application, when you click the link output target. |
dynDefCol |
This optional argument is a string that specifies the name of a table column (or columns, separated by commas) in which a preconfigured condition is defined for the pageset. When you click a link target containing a preconfigured condition, the application overrides the default settings of input UI controls in the pageset being loaded with the settings defined in the preconfigured condition. The definition of a preconfigured condition must contain the name of the overriding Feature table and the feature (CODE) value of the desired override setting. If you define a preconfigured condition column in a Configuration table, the dynDefCol argument references only the name of the Configuration table column whose values override the defaults. If you define a preconfigured column in a Feature table, the dynDefCol argument must contain the name of the Feature table and the name of the specific column inside of it whose values override the defaults, separated by a dot (as in COLOR.PRECONFIG). |
NOTE: Pagesets must be located in the application pg subdirectory.
Example
The following sample code creates a link output target based on a Configuration table column named CLINK: <SCRIPT>
document.write(ISS.BuildTarget("LINK",window,"CLINK", true));
</SCRIPT>If you liked this thing, you'll definitely like these other things.</a>
When the user selections match a valid configuration, a pageset ID in the CLINK column is returned. When the user clicks the button, the pageset is loaded and displayed in the application. Subconfiguration Link Output Targets
Set the type argument for the BuildTarget function to SUBCONFIG_LINK to create a subconfiguration link output target. Use a subconfiguration link output target to navigate to the user interface of a child pageset from its parent pageset, or from the child pageset back to the user interface of its parent pageset. The syntax used to create a subconfiguration link output target is: BuildTarget("SUBCONFIG_LINK",window,instanceName)
|
|
instanceName |
Name of the relative instance that describes the subconfigured child pageset. |
NOTE: Pagesets must be located in the application pg subdirectory.
Example
The following sample code links from a parent page to a BURGER child page: <SCRIPT>
document.write(ISS.BuildTarget("SUBCONFIG_LINK", window,"BURGER"));
</SCRIPT>Link to Hamburger</a>
Similarly, a child page links to its parent page using the following sample code: <SCRIPT>
document.write(ISS.BuildTarget("SUBCONFIG_LINK", window,"PARENT"));
</SCRIPT>Link to Burger Meal</a>
Subconfiguration link output targets can link a child pageset, or a nested parent pageset, to the topmost parent pageset by using the reserved word TOP as the instanceName argument: Done selecting cheese for your burger?
<SCRIPT>
document.write(ISS.BuildTarget("SUBCONFIG_LINK", window,"TOP");)
</SCRIPT>Link to Burger Meal</a>
Also, subconfiguration link output targets can link one child pageset to another by using the syntax PARENT:CHILD as the instanceName argument: Done creating your burger?
<SCRIPT>
document.write(ISS.BuildTarget("SUBCONFIG_LINK", window,"PARENT:FRIES");)
</SCRIPT>Would you like fries with that?</a>
Optional Subconfiguration Link Output Targets
Set the type argument for the BuildTarget function to OPT_SUBCONFIG_LINK to create an optional subconfiguration link output target. Use an optional subconfiguration link output target when a pageset is used for both a subconfigured item and a standalone item. For example, if your application allows users to build fast food value meals, suppose that a user wanted to buy a drink without purchasing any food. By using an optional subconfiguration target link to the parent pageset on the DRINK pageset, the same DRINK pageset could be used, regardless of whether the person is ordering a value meal. A subconfiguration link back to the parent is not appropriate unless the user arrives at the pageset from a parent pageset. The optional link does not appear unless the user arrives from a parent pageset. The syntax to create an optional subconfiguration link output target is: BuildTarget("OPT_SUBCONFIG_LINK",window,instanceName,preText,postText)
|
|
preText |
HTML and text to be written before the optional subconfiguration link output target. |
postText |
HTML and text to be written after the optional subconfiguration link output target. |
NOTE: Pagesets must be located in the application pg subdirectory.
Example
Use the following sample code: <SCRIPT>
document.write(ISS.BuildTarget("OPT_SUBCONFIG_LINK" window, "PARENT","<TR><TD>","Link to Burger Meal</A> </TD></TR>"));
</SCRIPT>
returns: "<TR><TD><a HREF="javascript:InstanceWrapper ('PARENT','window')">Link to Burger Meal</A></TD> </TR>"
if there is a parent. If there is not a parent, it returns an empty string (" "). Image Output Targets
When the value for the type argument for the BuildTarget function is PICT, an image output target is created. The image output target also uses optional Width and Height arguments. The syntax used to create an image output target is: BuildTarget("PICT",window,name[,width,height])
|
|
name |
Column in a Configuration table or Feature table that contains the name of an image file. |
width |
Optional. Specifies the width of the image, in pixels. |
height |
Optional. Specifies the height of the image, in pixels. |
Argument Notes
- If values for the width and height arguments are not defined, the application defaults to displaying the image at the actual size specified by the image file. In some browsers, rendering speed can be improved by explicitly specifying dimensions with the Width and Height arguments.
- The path to an image file is relative to the pg subdirectory.
Example
The following sample code creates an image output target that displays the file listed in the IMG column of a Configuration table: <SCRIPT>
document.write(ISS.BuildTarget("PICT", window,"IMG"));
</SCRIPT>
When the user selections match a valid configuration, the value in the IMG column is returned. This value is the name of the image file that appears in the output target. Text Output Targets
When the type argument for the BuildTarget function is set to TEXT, a text output target control is created. The syntax used to create a text output target is: BuildTarget("TEXT",window,name,[formatFunction])
|
|
name |
Column in a Configuration table, column in a Feature table, or a text UI control. |
formatFunction |
Optional. A pointer to a function used to format the display of the value that is often used to format numeric values. |
Example
The following sample code creates a text output target that displays an interior color selection. When the user selections match a valid configuration, a value in the DESC column is returned and displayed in the text output target. Note that this column is located in the Feature table COLORINT. <SCRIPT>
document.write(ISS.BuildTarget("TEXT", window,"COLORINT.DESC"));
</SCRIPT>
The following sample code displays a price text as a number with two decimal places. <SCRIPT>
document.write(ISS.BuildTarget("TEXT", window,"PRICE", ISS.ConvertFloatToCurrency));
</SCRIPT>
Content Sources for Output Targets
The name argument for the BuildTarget function refers to one of the following:
- A column in a Configuration table. In this case, the argument is simply the name of the column.
If the output target control is populated with data from a column in a Configuration table, the name argument is the column name only. The structure of the reference is:
ColumnName
For example, if an image output target is based on a Configuration table column called IMG, the syntax might be:
BuildTarget("PICT",window,"IMG")
- A column in a Feature table. In this case, the argument is the name of the Feature table and the name of the specific column inside of it, separated by a period.
The reference structure is:
TableName.ColumnName
For example, if a text output target is based on a DESC column in the Feature table called COLOR, the syntax might be:
BuildTarget("TEXT",window,"COLOR.DESC")
- The Feature table used to populate an input UI control from which the user has made a selection. In this case, the argument is simply the name of the Feature table.
In this case, the data from the CODE column for that table is returned and displayed in the output target. The reference structure is:
TableName
For example, if a text output target is based on a CODE column in the Feature table called PROCESSOR, the syntax might be:
BuildTarget("TEXT",window,"PROCESSOR")
- The name of a text entry input UI control in which text is typed and stored. In this case, the argument is the name you used to define the text entry input UI control.
For example, the following sample code might be used to create a text box UI control:
<SCRIPT>document.write(ISS.BuildWidget ("GETTEXT",window,"PLATETEXT",8))</SCRIPT>
The text that a user enters into the UI control is then saved as part of the selection set with the name reference PLATETEXT. The following sample code creates a text output target that displays this data:
<SCRIPT>document.write(ISS.BuildTarget ("TEXT",window,"PLATETEXT"))</SCRIPT>
N-Back Link Target
The N-Back Link target saves the input state of the current pageset and then load a specified pageset. You can create one or more N-Back Link targets per display page. The N-Back Link Target is used in conjunction with the N-Back Return target. For more information, see N-Back Return Target. The syntax used to create an N-Back Link output target is: BuildTarget ("NB_LINK", winObj, linktext, pagesetcol, returntext)
|
|
NB_LINK |
Specifies that this function will be used to navigate to a new pageset. |
winObj |
The window from which the call is made. |
linktext |
The text to appear for the Link or Return HREF. If returntext is specified when a Link is built, linktext is ignored during the construction of the corresponding Return target. |
pagesetcol |
Specifies the field of the data model that holds the name of the pageset to link to. |
returntext |
Optional Specifies the text to display for the return HREF. |
Example
document.write(ISS.BuildTarget("NB_LINK",window, "Accessories","DYNDEFS", "Return to Server Configuration"));
N-Back Return Target
The N-Back Return target is used to navigate back to the previous pageset and restore the saved input state for that page. You can create one N-Back Return target per display page. An N-Back Return target will only be constructed if called from a pageset of which the "TOP" instance was traversed to by an N-Back Link. Otherwise an empty string is returned. For more information, see N-Back Link Target. The syntax used to create an N-Back Return output target is: BuildTarget ("NB_RETURN", winObj, linktext, tokencol)
|
|
NB_RETURN |
Specifies that this function will be used to traverse back to the previous pageset. |
winObj |
The window from which the call is made. |
linktext |
The text to appear for the Link or Return HREF. If returntext is specified when a Link is built, linktext is ignored during the construction of the corresponding Return target. |
tokencol |
Optional Specifies the field of the data model that holds the key/value pairs of a preconfigured object for the link. |
Example
document.write(ISS.BuildTarget("NB_RETURN",window,"Return"));
|