Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Passing page-specific data to the reloaded page – PB Docs 150 – PowerBuilder Library

Passing page-specific data to the reloaded page – PB Docs 150

Passing page-specific data to the reloaded page

Using self link information

The first time the client browser requests the page template,
it can pass page-specific information using GET or POST, and the
page can use those values in the server-side scripts. However, when
the page is reloaded because of user interactions with the Web DataWindow,
that information is not passed to the page automatically.

To make the information available, you specify a selflinkargs string
with values that become page parameters in the reloaded page. Typically,
you would use self-link parameters to keep available:

  • Login information from another page

  • The DataWindow object name

  • Retrieval arguments for the DataWindow object

To provide these values when the page is reloaded, you use
the SetSelfLink method, which takes as arguments the URL of the
page template as well as the selflinkargs string.

To reload the page correctly in response to user actions,
the server component needs to know the URL of the page template.
You can get this information from the name property of the document
object header or the SCRIPT_NAME server variable.

Building a self-link argument string

Self-link arguments become page parameters in the reloaded
page. Your script typically looks at an existing page parameter
and re-creates it using a self-link argument. The syntax for specifying
a self-link argument string is:

The string can contain one or more page parameter and expression
pairs separated by pipes ( | ). Each expression is a DataWindow
expression that evaluates to a string. Usually you specify constant
string values that are already values of page parameters rather
than expressions.

The expression is enclosed in quotes, and if the value is
a constant, it must also be enclosed in quotes. For example, if
a page parameter has the value Johnson, the
value of the expression must be enclosed in two sets of quote marks: '"Johnson"'

To get the value from the current Logname parameter, which
is already defined for the page, you build the expression using
the Logname page parameter. The single quotes and inner double quotes
are embedded in the expression. The current value is inserted between
the quotes:

An expression does not need the inner quotes:

Passing the URL and argument string to SetSelfLink

SetSelfLink

Use the URL and the link arguments string as arguments to
the SetSelfLink method:

Retrieval arguments as self-link values

The first time the page is loaded, the retrieval argument
might be:

  • A page parameter passed from another
    page. The user might have clicked a URL that included the value
    or filled in a form that posted the value.

  • A new value calculated in the current script.

If the value is a page parameter, then you can re-create the
page parameter using SetSelfLink. If the value is from some other
source, you need to write code that gets the value from the source
(which might be a page parameter) the first time the page is loaded
and from a page parameter when it is reloaded.

Examples

These examples show code that works with the types of values
listed above. They illustrate how to get each type of value and
use it in both RetrieveEx and SetSelfLink method calls.

Value from another page

If the user entered a product ID in a form to get detailed
information on the product, the product ID is passed to the product report
template as a page parameter. The page parameter should always exist because
it comes from the calling page, but the code provides a default
value anyway:

Multiple values

In this example, a Web page with a form prompts the user for a
user name and a product category and the level of detail the user
wants to see. The code uses the product category as a retrieval
argument for the Web DataWindow. The script selects a DataWindow
object based on the level of detail. All three values are carried
over each time the page is reloaded:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x