Web Connect How To : Show Me the Code!

 LAFOX Home How URL Maps to Code  LAFOX Design Oveview  Framework Extensions 
*Tips.prg #INCLUDE WCONNECT.H ************************************************************* DEFINE CLASS Tips AS rbPage ************************************************************* ************************************************************* ** Tips.Page() ** Merge in the Tips Fragment ************************************************************* FUNCTION Page() LOCAL loDataManager STORE .NULL. to loDataManager loDataManager = This.DataManager() This.Content = This.DataGrid(loDataManager) This.PageTitle = "VFP Tips and Tricks" This.Merge("TemplatePage.htm") ENDFUNC &&TipsPage HIDDEN Function DataManager LOCAL loDataMan STORE .NULL. to loDataMan ** Remember to set procedure to DataLayer.prg additive!! loDataMan = CreateObject("DataManager") loDataMan.SQL = [Select * from ]+Site.DataPath+"Tip.dbf where approved = .T. order by Title" loDataMan.PageSize = 20 && Defaults to 20 - for next prev pages automatically loDataMan.QueryAsNeeded() &&New Name?? Name the 3 functions RETURN loDataMan ENDFUNC HIDDEN FUNCTION DataGrid(toData) LOCAL lcHTML, lcNewTipLink LOCAL loTable STORE .NULL. to loGrid STORE [] TO lcHTML, lcNewTipLink ** Required ** Remember to set procedure to HTMLTable.prg additive!! loGrid = CreateObject("DataGrid", toData) ** Optional - defaults to ALL fields ** Creates a column object for each field ** Will create This.Col_LastName, This.Col_FirstName etc ** Col_FieldName :-) loGrid.FieldList = [Title,Tip,PostedBy,PostedDate] ** Optional - defaults to Field Names loGrid.CaptionList = [Title,Tip,Posted By,Posted Date] ** Optional - all columns default to sortable ** For this column no sort - they all look the same loGrid.Col_Title.Sortable = .F. loGrid.Col_Tip.Sortable = .F. loGrid.Col_PostedBy.Sortable = .F. loGrid.Col_PostedDate.Sortable = .F. lcNewTipLink = [<br><a href="/tipsubmit.page.fox?SessionID=_4WE0C01IL">Submit New Tip</a><br>] lcHTML =[<B>]+This.PageTitle+[</B>] ; +lcNewTipLink ; +loGrid.HTMLGrid() ; +loGrid.HTMLNavBar() RETURN lcHTML ENDFUNC ENDDEFINE
csCodeParser v0.9 stats: 68 lines in 0.00 seconds.