OneTrip (obsolete)
Description
Generates HTML syntax for the Web DataWindow after setting values
that refresh the state of the server component so that it is in sync with
user actions.
Obsolete method
OneTrip is obsolete and should not be used, because the Web
DataWindow technology is obsolete.
Applies to
|
DataWindow type |
Method applies to |
|---|---|
|
Web |
Server component |
Syntax
Web DataWindow server
component
|
1 2 3 4 5 |
string dwcomponent.OneTrip ( string htmlobjectname, string browser, string selflink, string selflinkargs, string action, string context ) string dwcomponent.OneTripEx ( string htmlobjectname, string retrievalargs, string browser, string selflink, string selflinkargs, string action, string context ) |
|
Argument |
Description |
||
|---|---|---|---|
|
dwcomponent |
A reference to a Web DataWindow server |
||
|
htmlobjectname |
A string specifying a name used in generated code for |
||
|
retrievalargs |
A string that contains the values of the retrieval |
||
|
browser |
A string identifying the browser and version. The Sets the value of the HTMLGen.Browser For information on recognized browsers, see |
||
|
selflink |
The URL for the current page. It cannot include The server component uses SelfLink to Sets the value of the |
||
|
selflinkargs |
A string in the form:
Argname Exp is a Sets the |
||
|
action |
A string describing an action associated with a |
||
|
context |
A string describing the context of action in the Web The format is not |
Return value
Returns the generated HTML if it succeeds and an error message if
any of the requested settings fails.
Usage
OneTrip and OneTripEx perform the tasks of SetSelfLink, SetBrowser,
Retrieve, SetAction, and Generate in a single method. They are meant to be
used with a server component that has been previously configured with a
DataWindow definition and transaction information. Using OneTrip produces
maximum performance for the Web DataWindow client while allowing the
server component to remain stateless.
Use OneTripEx instead of OneTrip if you need to specify retrieval
arguments. The retrievalargs string in the OneTripEx syntax has the
format:
|
1 2 3 4 |
value1 value2 value3... value16 |
The values of the retrieval arguments must be separated by newline
characters (
) and individual values cannot contain newline characters as
part of the value. The Web DataWindow supports up to 16 retrieval
arguments.dd
You can specify an array for the value of a retrieval argument by
separating the array values with a tab character ( ). For example, if the
DataWindow expected an array for the second retrieval argument, the syntax
would be:
|
1 2 3 |
value1 value2a value2b value2c value3... |
If the script gets the values for the retrieval arguments from page
parameters, you must also specify the retrieval arguments as selflinkargs
expressions, so that the values will be available as page parameters when
the page is reloaded.
The evaluated selflinkargs expressions are included in the generated
HTML as hidden fields and are available to server-side scripts as page
parameters. You can use the arguments to supply information that the
server component needs to render additional pages of the result set, such
as retrieval arguments. Selflinkargs can also be used to keep login
information or other data available that was passed in the original call
to the page.
For information on quotation marks and other formatting for the
expression, see the SetSelfLink
method.
Examples
This Web Target server-side script uses OneTripEx to get generated
HTML. The DataWindow object expects two retrieval arguments, an employee
ID and a salary:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
function GetParam( envparam ) { if( exists(document.value[envparam] ) ) { return document.value[envparam]; } return ""; }; // Create component on server dwMine = java.CreateComponent("DataWindow/MyVersion", "iiop://testMachine:9000", "jagadmin", "", "DataWindow/HTMLGenerator110"); // Get information about user's latest button click var action = psDocument.GetParam("dwMine_action"); var context = psDocument.GetParam("dwMine_context"); // Get browser and hyperlinking information var browser = psDocument.GetEnv("HTTP_USER_AGENT"); var selfLink = psDocument.GetEnv("SCRIPT_NAME"); // Get retrieval arguments from page parameters var args = "" + psDocument.GetParam("arg_empid") + " " + psDocument.GetParam("arg_salary"); // Set up page parameters for reloaded page linkargs = "arg_empid ='"" + psDocument.GetParam("arg_empid") + ""'" + "|arg_salary= '"" + psDocument.GetParam("arg_salary") + ""'"; // Include the generated HTML in the Web page psDocument.Write(dwMine.OneTripEx("dwMine", args, browser, selfLink, linkargs, action, context) ); |
See also