- Start
- License
- Framework
- First steps
- Updates
- XA_Functions
- WApp
- WAutoComplete
- WBasic
- WBasicCheckbox
- WBasicContext
- WBasicDateTime
- WBasicEdit
- WBasicEmail
- WBasicNumber
- WBasicRadio
- WBasicSelect
- WBasicSelectItem
- WBasicStyle
- WBreadcrumb
- WButton
- WCard
- WCarousel
- WCarouselImage
- WCarouselPanel
- WCheckbox
- WChip
- WCmpButtonIcon
- WCmpButtonSpinner
- WCmpNumericKeypad
- WCollapsible
- WCollapsiblePanel
- WCollection
- WCollectionItem
- WColor
- WContainer
- WContext
- WContextHelper
- WControl
- WCookie
- WCss
- WDatePicker
- WDateTime
- WDiv
- WDoc
- WDocSection
- WDropDownItem
- WDropdown
- WDump
- WEdit
- WEmail
- WEngine
- WFetch
- WFieldset
- WFile
- WFlexRow
- WFloatActionButton
- WFloatActionButtonItem
- WFooter
- WForm
- WHeader
- WIconGoogle
- WImage
- WInput
- WInputImage
- WInputMask
- WInputText
- WLabel
- WLink
- WList
- WListItem
- WMain
- WMariaDbDatasource
- WMariaDbQuery
- WMaterialBox
- WMaterializeContext
- WMaterializeHelper
- WMeta
- WModal
- WModalMsgBtn
- WModalObject
- WNav
- WNavbar
- WNavbarItem
- WNavbarLogo
- WNumber
- WPackage
- WPagination
- WPaginationItem
- WParagraph
- WPdf
- WPdfAutoTable
- WPdfAutoTableStyle
- WPdfStyle
- WPhpRunner
- WPostFile
- WPreloader
- WRadio
- WRadioMenu
- WRange
- WRouter
- WScript
- WSelect
- WSelectItem
- WSession
- WSidenav
- WSidenavHeader
- WSidenavItem
- WSimpleContext
- WSlider
- WSliderItem
- WSpan
- WSqliteDatasource
- WSqliteQuery
- WStyle
- WSwitch
- WSyntaxHilite
- WTable
- WTableCell
- WTableColGroup
- WTableRow
- WTableTask
- WTableZone
- WTabs
- WTabsItem
- WTask
- WText
- WTextArea
- WTimePicker
- WTooltip
- WTranslator
- WWaterContext
- WXailerMariaDbDatasource
- WXailerSqliteDatasource
- WXailerWebDatasource
- Method WDoc :Reload
-
Parameters
cAction
Name of the 'action' type method to be executed. By default, blank, indicating that only the default page will be loaded.
cDocumentName of the document to be executed. By default, the current one.
-
Return value
NIL
It allows you to instantly reload the document. It is recommended to use it every time you update a persistent property of the document and need to reload the document with the new information. The persistence system is important to understand: All PERSISTENT properties are saved in a JSON file within each user session. They are saved exactly when the CGI is deployed, and they are retrieved at the same time the WDoc object is instantiated. For this reason, the following limitations must be taken into account:
- You can only set the initial value of a persistent DATA in the class definition itself. Anything else causes the persistence value received by the session to be lost.
- When you set the value of a persistent DATA, it will ONLY have that new value, in all subsequent code and the next time you run the CGI.
- When WDoc is instantiated, the first thing that runs is its DocStart() method, then any methods you have specified as services or actions, and finally all the sections you have registered with the WDoc:RegisterSection(
) method.
METHOD Frm_SectionCheck( hParams ) CLASS WDocMain
LOCAL cUser := hParams[ "user" ]
LOCAL cPass := hParams[ "password" ]
IF cUser == "admin" .AND. cPass == "1234"
::cUser := cUser
Document:Reload()
ENDIF
RETURN oSection
However, there is a more elegant way to do this, without reloading, which is using the WDoc:RegisterSection method. This method allows you to set sections that will be processed after the 'Action' or 'Post' method you specified has been executed. Therefore, the solution is simple: minimize the code you place in the StartDoc() method and place it in sections that you will register with the RegisterSection() method.