OneTrip method (DataWindows)
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.
OneTripEx
A separate method name is provided as an alternative syntax
because the Web DataWindow server component cannot use overloaded
methods.
Controls
|
DataWindow type |
Method applies to |
|---|---|
|
Web |
Server component |
Syntax
[Web DataWindow server component]
|
1 |
string <span>dwcomponent</span>.OneTrip ( string <span>htmlobjectname</span>, string <span>browser</span>,<br> string <span>selflink</span>, string<span> selflinkargs</span>, string <span>action</span>, string <span>context</span> )<br>string <span>dwcomponent</span>.OneTripEx ( string <span>htmlobjectname</span>, <br> string <span>retrievalargs</span>, string <span>browser</span>, string <span>selflink</span>, <br> string <span>selflinkargs</span>, string <span>action</span>, string <span>context</span> ) |
|
1 |
|
Argument |
Description |
||
|---|---|---|---|
|
dwcomponent |
A reference to a Web DataWindow server |
||
|
htmlobjectname |
A string specifying a name used in generated |
||
|
retrievalargs |
A string that contains the values of |
||
|
browser |
A string identifying the browser and Sets the value of the HTMLGen.Browser property for the DataWindow For information on recognized browsers, see HTMLGen.property. |
||
|
selflink |
The URL for the current page. It cannot The server component uses SelfLink to generate URLs for navigation Sets the value of the HTMLGen.SelfLink property for the DataWindow |
||
|
selflinkargs |
A string in the form:
Argname is an argument passed to the Exp is a DataWindow expression whose Sets the value of the HTMLGen.SelfLinkArgs property for the |
||
|
action |
A string describing an action associated |
||
|
context |
A string describing the context of action in The format is not documented and subject to change. |
Return Values
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 an EAServer 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 |
<span>value1</span> <span>value2</span> <span>value3</span>... <span>value16</span> |
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.
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 |
<span>value1</span> <span>value2a</span> <span>value2b</span> <span>value2c</span> <span>value3</span>... |
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. For information about
using the Web DataWindow, see the DataWindow Programmers
Guide.
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 |
function GetParam( envparam ) { |
|
1 |
if( exists(document.value[envparam] ) ) { |
|
1 |
return document.value[envparam]; |
|
1 |
} |
|
1 |
return ""; |
|
1 |
}; |
|
1 |
|
1 |
// Create component on server |
|
1 |
dwMine = java.CreateComponent("DataWindow/MyVersion", |
|
1 |
"iiop://testMachine:9000", "jagadmin", "", |
|
1 |
"DataWindow/HTMLGenerator126"); |
|
1 |
|
1 |
// Get information about user's latest button click |
|
1 |
var action = psDocument.GetParam("dwMine_action"); |
|
1 |
var context = psDocument.GetParam("dwMine_context"); |
|
1 |
|
1 |
// Get browser and hyperlinking information |
|
1 |
var browser = psDocument.GetEnv("HTTP_USER_AGENT"); |
|
1 |
var selfLink = psDocument.GetEnv("SCRIPT_NAME"); |
|
1 |
|
1 |
// Get retrieval arguments from page parameters |
|
1 2 |
var args = "" + psDocument.GetParam("arg_empid") + " " + psDocument.GetParam("arg_salary"); |
|
1 |
|
1 |
// Set up page parameters for reloaded page |
|
1 |
linkargs = "arg_empid ='"" + |
|
1 |
psDocument.GetParam("arg_empid") + ""'" |
|
1 |
+ "|arg_salary= '"" + |
|
1 |
psDocument.GetParam("arg_salary") + ""'"; |
|
1 |
|
1 |
// Include the generated HTML in the Web page |
|
1 |
psDocument.Write(dwMine.<span>OneTripEx</span>("dwMine", args, |
|
1 |
browser, selfLink, linkargs, action, context) ); |