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

Setting up page navigation – PB Docs 90 – PowerBuilder Library

Setting up page navigation – PB Docs 90

Setting up page navigation

One of the
major tasks when creating a set of Web pages is managing how one page
links to another and how data is passed from one page to the next.
4GL Web pages help manage page data accurately and efficiently when
a Web application requires navigation from one page to another.

About page navigation

On 4GL Web pages, the type of link you use determines how
data gets passed from a linking page to a target page.

Navigation styles

You can link
from one page to another using any of three navigation styles:

  • A hyperlink using the HTML <A> element
  • A form submit for the page
  • A server redirection using self-navigation (where
    the form representing the current page submits back to itself)

All three styles let you bind parameters to target pages,
but the level of support for binding varies. Which navigation style
you choose depends on how you want data passed, whether or not the
data requires processing by the server, and the flexibility you
need.

Most 4GL Web pages navigate to other pages by server redirection.
It presents the most flexible way to navigate from one page to another.

Summary of advantages and disadvantages of navigation
styles
These are the advantages and disadvantages of the three navigation
styles:

Table 9-5: Navigation
style advantages and disadvantages
Navigation Advantages Disadvantages
Hyperlink
  • Jumps directly
    to another page without server processing
  • Works well with a range of different target pages
    when processing is unnecessary before moving to the target page
  • Allows non-matching names for parameter binding
    (binding defined in HREF attribute in page source)
  • Requires the values
    of parameters to be available when the page is generated.
  • Does not return to the server to process current
    page before moving to the next page (not all parameters and variables
    are available to the target page).
  • Does not support server actions.
  • Does not support validation before navigation.
  • Does not allow the user to recover from errors caused
    by entering data in an invalid format.
Form submit
  • Jumps directly
    to another page without server processing
  • Requires the target
    page to define parameter names to match the parameters passed.
  • Provides only the data from the fields on the page
    form.
  • Does not support validation before navigation.
Server redirect
  • Supports validation
    and server actions
  • Processes the values of parameters before passing them
    to a target page
  • Allows non-matching names for parameter binding
    (binding defined in server script)
  • Retains the values of parameters and makes all the
    data available for parameter binding
  • Lets you redirect the client to another page from
    the middle of a server script
  • Lets you stop navigation if validation fails
  • Loads a current
    page, then the target page in the user’s browser (making
    this method slower than the other two styles).
  • Does not allow you to add FORM elements to a 4GL
    Web page (a FORM represents an entire 4GL Web page). You can still
    insert form field controls, but they are not surrounded by FORM
    tags in Source view.

Target pages

When
you develop Web pages, you can specify a target page that already
exists, or one that you plan to create. If you specify a page that
already exists, you can bind values from the linking page to the
parameters of the target page. If you specify a page that does not
yet exist, you can set parameters on the linking page; then, when
you create the target page, you specify which parameters it requires
of those being passed from the linking page. For more information about
page parameters, see “Setting up page parameters”.

Parameter binding

When you establish
navigation from one page to another, you can bind values from the
linking page to parameters on the target page. 4GL Web pages support several
types of parameter bindings:

Table 9-6: Parameter
binding for 4GL Web pages
Type of binding Description Navigation style restrictions
Constant A fixed value Not available for form submit.
Page Variable A variable whose value is set on the server Only initial value used by hyperlink (cannot
be changed by client). Variable name must match parameter name on target
page for form submit.
Page Parameter A parameter whose value is set on the
server
Only initial value used by hyperlink (cannot
be changed by client). Parameter name must match parameter name
on target page for form submit.
Expression The value of an expression set on the
server
Not available for form submit.
Control The value property of a server object Not available for hyperlink.

The user interface for binding parameters is different for
each navigation style:

Table 9-7: Information
about navigation style and parameter binding
Navigation style For information, see
Hyperlink “Managing client hyperlinks”
Form submit “Managing client form submission”
Server redirect “Managing server redirection”

Managing client hyperlinks

For client hyperlinks, an HTML anchor <A> element
directly links one page to another. On the linking page, you specify
the parameters (including the type of binding and the value for
the parameter) you want to pass to parameters on the target page.

The following drawing illustrates how parameters are made
available to a target page from a hyperlink on a linking page in
a Web site target. Parameters are passed the same way for JSP targets,
except that the target and linking pages would typically have .jsp extensions
instead of the .htm extensions displayed in
the drawing:

Figure 9-1: Passing parameters in a hyperlink

navlink.gif

The server sets the parameters sent to the target page. Only
initial values are passed to the target parameters; client-entered
values are not processed.

proc.gif To pass parameters with a client hyperlink:

  1. Drag an HTML A element
    from the Language tab of the System Tree to a 4GL Web page in the
    HTML editor (Page or Source view).
    or

    Click
    the hyperlink tool button in the painter bar for the HTML editor
    with a 4GL Web page open in Page or Source view.

    The Hyperlink Properties dialog box displays.

  2. On the Hyperlink page, specify link information,
    including a target page destination.

    Make sure the Server-Side Scriptable check box is selected.

  3. On the Parameters page, specify page parameters
    for the target page, the type of binding for each parameter, and
    the value from the current page that you want to bind to each parameter.

    If the target page exists and has page parameters defined
    for it, these parameters display automatically under the Parameter
    Names column. They are available for binding to constants, expressions,
    page parameters, and page variables from the current page.

    You can add new parameters to the list and define them later
    in the target page. Parameters and variables on the current page
    automatically display under the Bind Value column when you select
    a bind type of Page Parameter or Page Variable, respectively.

    alnkbind.gif

  4. Click OK after you finish setting the hyperlink
    properties.

Managing client form submission

On
4GL Web pages, a form represents a page
. When
a user action submits a page form, the form can submit to the same
page (self-navigation) to refresh a page in the user’s
browser or to prepare for a server redirection. Otherwise, it can
be submitted directly to another page (form submit). For more information about
server redirection, see “Managing server redirection”.

When a form submits directly to another page, the data passed
to the target page must already be available from the linking page.
The following data is available to the target page:

  • Values for server-scriptable controls
  • Client-side parameters (including parameter values
    set on the client)

For a form submit, the names of the client controls must map
to (match) the names of the parameters on the target page. To take
advantage of the Web Target interface for the form submit navigation
style, you must first set the parameter names on the target page.
The 4GL Web page does not provide parameter and variable management
for forms directly submitted to another page.

note.gif No forms on 4GL Web pages You should not add FORM tags to 4GL Web pages. If you change
a non-4GL page to 4GL mode, you must manually remove any FORM tags
in Source view. For 4GL Web pages, the entire page is represented
as a single form.

The following drawing illustrates how parameters get passed
when a page form submits directly to another form in a Web site
target. Parameters are passed the same way for JSP targets, except
that the target and linking pages would typically have .jsp extensions
instead of the .htm extensions displayed in
the drawing:

Figure 9-2: Passing parameters in a form submit

navform.gif

For a fuller description of how to pass parameters using the
form submit navigation style, see “Using parameters and variables”.

proc.gif To set parameter bindings:

  1. Right-click the linking page in the HTML
    editor, then select Page Properties from the pop-up menu.

    The Page Properties dialog box displays.

  2. Click the Parameters tab.

    or

    Click the Variables tab.

  3. Click the New button, and add a parameter or variable
    with the same name as a parameter on the target page.

    For parameter binding purposes, the names you type are case
    sensitive. The parameter or variable name on the linking page must
    exactly match the parameter name on the target page.

    For steps to add a parameter, see Setting up page parameters. For steps to add a variable, see Setting up page and session
    variables
    .

  4. Repeat steps 2 and 3 for each parameter and variable
    you want to add to the current (linking) page.

  5. Click the Destination tab on the open (linking)
    page.

  6. Select the Submit To URL radio button option.

    Click the browse (…) button and select your target
    page from the Choose URL dialog box.

    The parameters of the target page are listed in the Parameter
    Name column of the grayed-out list box. You cannot directly modify
    the items in this list.

    If a parameter or variable name on the current (linking) page
    matches a parameter on the target page, the matching name is listed
    in the Bind Value column. The Bind Type indicates whether the matching
    name is a page parameter or page variable on the current page.

    pagevar.gif

  7. Click Apply.

Managing server redirection

4GL Web page navigation

4GL
Web pages provide added support for navigation between pages. Server redirection
is the navigation style of choice when a parameter value passed
to another page relies on user input, or when you want to validate
user input. The 4GL Web page generates the server script that specifies
the target page and the values that get passed to parameters on
the target page.

A server redirection can initiate a link to another page from
anywhere in a server script. Typically you add a Redirect call
in a ServerAction event for a command or picture button, or in the
AfterAction event for the psPage object or a Web DataWindow control
that you place on the page.

All server data is available for parameter binding, because
the redirection occurs in the server script. The page gets processed
by the server, enabling the page to take advantage of all variables
available there. Because the ASP object model does not support 4GL
functionality, server redirection is not available for ASP targets.

The following drawing illustrates how parameters get processed
in a PowerDynamo application when a server redirection displays
another page. Parameters are passed the same way for JSP targets,
except for the application server name. Also, the target and linking
pages in a JSP application would typically have .jsp extensions
instead of the .htm extensions displayed in
the drawing:

Figure 9-3: Passing parameters in a server redirect

navself.gif

Setting up a server redirection

You can set up a server redirection from the integrated Script
editor by selecting a server event, then specifying the target page
and the parameters to pass to that page. The script is created for
you.

proc.gif To set up a server redirection from the integrated
Script editor:

  1. In a server script or in the script for
    a control with a server action event selected in the events list,
    right-click in the Script editor.

  2. Select Insert Redirect from the pop-up menu.

  3. In the Redirect Properties dialog box, specify
    the target file or URL.

  4. Specify the target page parameters, the type of
    binding for each parameter, and the value you want to bind to the
    parameter.

    If the target page exists with input parameters identified
    for it, these parameters appear in the list of parameters on the
    Redirect page. You can edit these parameters and add new ones.

    redrparm.gif

  5. When you finish setting the Redirect Properties,
    click OK.

    The Script editor inserts a block of code. You can modify
    or remove this block of code using the pop-up menu.

Changing parameter bindings

You can change the binding for parameters from the Redirect
Properties dialog box.

proc.gif To change parameter bindings or parameter values
for a server redirection:

  1. Right-click in the Redirect code in the
    integrated Script editor.

  2. Select Edit Redirect from the pop-up menu.

  3. In the Redirect Properties dialog box, make any
    changes needed to the parameter definitions.


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