Scenario: Cross-Product Poll System

LANSA

Scenario: Cross-Product Poll System
Example 190
The Things that Make Up this ExampleTo Execute this Example

In this example:
  • Visual LANSA is used to set up polls and to analyse results. Visual LANSA connects to the iSeries database using super-server.
  • LANSA for the Web is used to deliver the poll.
  • The data is stored in the iSeries database which has its own layer of validation and which is reliable and allows easy access.


Using LANSA for the Web makes the delivery of the poll and the collection of the responses simple and reliable: the user can go backwards and forwards along their list of questions without losing their responses. If required, the iSeries can handle additional validation and pre-processing.

Compared with a traditional green-screen hierarchy of maintenance functions, the use of Visual LANSA for the creation and maintenance of the polls has these benefits:
  • It’s immediately clear to the user how the poll maintenance is organized
  • The users can easily see what changes they can make
  • Navigation is quick
  • Complex combinations of available options can be made available
  • Graphs
  • Direct links to the internet poll
Notes and Suggestions

You cannot execute this example on Windows web servers.

Additional performance options are also available (though not required in this example). Super-server allows the Visual LANSA program to run a server function on the iSeries, which could be used for high speed database processing. And for those situations where the data is relatively static (e.g. analyzing the data for a closed poll), performance could be improved in the Visual LANSA program by loading all the data in one go and then manipulating the data using the SPACE built-in functions.

Extensive use is made of re-usable parts, primarily for encapsulation, rather than for code re-use.

Note the method of programmatically setting the focus in a list view (in S_190RPL and S_190RQL) and how this differs for a combo box (in S_190RQN).

Note how input capable fields within a component are handled in a web function:
Note how a browselist can be used to give a dynamic variable length list of radio button options: (function SET190A component S_190SERB)

Note how a system variable *S_190PID is set up to always get the next value from the iSeries (instead of from the local PC) using system variable evaluation program SETWEBN

There are also examples of buttons that pass a parameter in field S_ACTIONX (S_190APRV S_190ANXT S_190AFIN) using the Java Script routine NextButton in SET_190_SCRIPT

And an example of standard selection from a browselist in a re-entrant web function: (function SET190A component S_190SEGP)



Keywords
Example 190Graphs - Visual LANSA
Re-usable parts – Visual LANSARadio buttons - variable length lists of radio buttons on web
Re-entrant web functionBrowselist selection in a re-entrant web function
Input capable fields in web components Positioning in a list view and combo box – Visual LANSA
System variables on the server using super serverFocus, list view and combo box
List view, setting focusCombo box, setting focus
Example 190