Class wwShowCursor

Contained in wwShowCursor.prg

The wwShowCursor class allows for easy display of table based data in HTML form. Its main functionality is to show a FoxPro table as HTML table output for a list display using a single method call. There are also methods for displaying a single record either as ASCII output (handy for email messages) or as an HTML table for display on an HTML page.



Remarks

IMPORTANT: By default the various Show methods use the currently active cursor WHEN THE OBJECT IS CREATED!!! So make sure you issue the object creation code following the cursor selection or SQL statement of the cursor you want to render. Alternately you can call BuildFieldListHeader() explicitly to 'reselect' the currently active cursor.

Class Members

MemberDescription
BuildFieldListHeader This method allows you to pass a set of headers as an array to the object prior to calling one of the Show... methods.
o.BuildFieldListHeader(lvHeader,llPrelist)
EditRecord This method displays all fields of the table in editboxes for editing. The name of the HTML field matches the field name so you can retrieve any results with Request.Form("FieldName").
o.EditRecord(lnDisplayMode,lcObjectName)
EditTable The EditTable method can handle full table editing with a single method call.
o.EditTable()
GetOutput If you don't pass in an existing wwResponse object, this method will return the output of the generated HTML. If you don't pass in a wwresponse object, wwShowCursor creates one internally and GetOutput() returns the output as a string.
o.GetOutput()
SaveRecord Saves HTML form variables with the same names as the actual database fields into the currently open record of the database. This method is meant to be used in response to a EditRecord() created HTML form which contains all fields.
o.SaveRecord()
SetCursor Use this method to set a DBF or cursor other than the currently selected Alias
o.SetCursor(lcDBF)
ShowASCIIRecord Shows all the fields of the current record in ASCII format. This is useful for sending emails or other operations that can't use HTML as the presentation format.
o.ShowASCIIRecord()
ShowCursor Renders a cursor to HTML into the internal Response object. This method generates the list, but you have to use GetOutput() to retrieve a string.
o.ShowCursor()
ShowObject Displays an object's property values as an HTML table.
o.ShowObject(loObject)
ShowRecord Shows all the fields of the current record in an HTML table.
o.ShowRecord()
cAlternatingBGColor The background color used for alternating rows if lAlternateRows is set to .T.. The colors will alternate between this color and cTableBGColor.
cBaseUrl Property that determines the base Url of the ShowCursor request.
cCellPadding Cell Padding for the table.
cCellSpacing Cell Spacing for the table.
cExtraTableTags Any extra TABLE tags that are to be appended to the <TABLE> statement.
cHeaderBGColor Background color for the table header. Use HTML color names or Hex color values.
cHeaderColor The color of the header font.
cHeaderFont The font used for the table header that shows the field labels.
cKeyField The type of the key field used to identify records. Default is "N" for numeric.
cKeyFieldType VFP Type for the key field used in EditTable(). Defaults to "N" numeric. Used only by EditTable and is required for any update operations.
cPage_PageURL The base URL used for paging. This URL will be appended with additional values for page count and total recs.
cRecordFieldList Field list filter used when displaying a single record with ShowRecord(). List should be a comma-delimited list of fields or field expressions that are to be displayed. This value becomes the field list value in a SQL Cursor SELECT statement.
cTableBGColor Background for the HTML table.
cTableBorder Border width of the table as a string value. Default = 1.
cTableEditFieldList Allows you to provide a comma delimited list of fields that are to be displayed in edit view. If not passed all fields in the current cursor will be displayed.
cTableFieldList This property determines the field list of fields to be displayed in ShowCursor() list display.
cTableSortColumn Used if you provide a customized field list in cTableFieldList to determine the sortorder. Choose the column name of the table or a numeric value of the column if a complex field.
cTableTitle Header for the table.
cTableWidth Width of the table as a string. Use real pixel value or a % value.
lAlternateRows Property that determines whether the ShowCursor display varies the color of odd and even rows for a ledger look.
lCenterTable Centers the table if set.
lShowAsTable Determines whether the table is displayed using a table or <pre> tags.
lSortable Allows columns in the data list view (ShowCursor()) to be sorted by showing the column headers with Ascending and Descending links next to them.
lSumNumerics If .T. all numeric fields are summed and totalled on the bottom of the table.
nForceToPreList This number is the number of cells that are the limit of the size for the table displayed. If this number of cells is exceeded the table will automatically revert to a <pre> formatted list.
nPage_ItemsPerPage If in paging mode this property determines how many items to display per page.
nPage_ShowPage Use the nPage_ShowPage property to go to a specific page in the paging list. This parameter is optional and is retrieved from the URL containing a PAGE= value if not specified. If neither exists the first page is displayed.

Requirements



  Last Updated: 9/6/2003 | © West Wind Technologies, 2008