Hi Jane,
I really would like to set the theme as early as possible, and with static dataset this is easy.
As I understand it, with multiple datasets the Webhandler - Processlink is the best place to set the users dataset, and this works fine now.
And here I also read the user theme.
See the code below.
I will see if I can make it to the Thursday webinar.
Webhandler - Processlink:
ds_outputdebugstring( 'Webhandler Processlink - p_web.GetValue(a) 1: ' & p_web.GetValue('a') )
ds_outputdebugstring( 'Webhandler Processlink - p_web.GSV(CommandA) 1: ' & p_web.GSV('CommandA') )
!ANY PARAMETER? IF NOT DEFAULTS TO '1', BUT ONLY IF p_web.GSV('CommandA') IS NOT SET:
IF p_web.GetValue('a') <> ''
p_web.SetValue('CommandA', p_web.GetValue('a'))
p_web.SSV('CommandA', p_web.GetValue('a'))
!LOGS OUT
p_web.SSV('Med_Init', '')
p_web.SSV('Med_Navn', '')
p_web.SSV('Med_Email', '')
p_web.SetSessionLoggedIn(0)
ELSE
IF p_web.GSV('CommandA') = ''
p_web.SetValue('CommandA','1')
p_web.SSV('CommandA', '1')
END
END
ds_outputdebugstring( 'Webhandler Processlink - p_web.GSV(CommandA) 2: ' & p_web.GSV('CommandA') )
!SETTING THE DATAPATH - A FOLDER OFF THE STATIC PATH IN GLO:StellarProgSti
GLO:RegnskabsNummer = p_web.GSV('CommandA')
p_web.SSV('GLO:RegnskabsNummer', GLO:RegnskabsNummer)
GLO:DataSti = CLIP(GLO:StellarProgSti) & '\' & p_web.GSV('CommandA')
p_web.SSV('GLO:DataSti', GLO:DataSti)
p_web.SSV('DataPath', p_web.GSV('GLO:DataSti'))
ds_outputdebugstring('Webhandler Processlink - GLO:DataSti: ' & p_web.GSV('DataPath'))
IF EXISTS( GLO:DataSti )
GLO:Inifil = clip(GLO:DataSti) & '\MobilService.ini'
p_web.SSV('GLO:Inifil', GLO:Inifil)
include('\pstellar_filename_defs_Slim.inc') !THIS IS WHERE THE FILENAMES ARE BUILD
!GETTING CUSTOMER NAME FROM INI
g:KundeNavn = GETINI('KundeProg','Kundenavn_' & p_web.GSV('CommandA') ,'' , clip(path()) & '\KundeProg.ini')
IF CLIP(g:KundeNavn) = ''
!GRABS DEFAULT:
g:KundeNavn = GETINI('KundeProg','Kundenavn' ,'' , clip(path()) & '\KundeProg.ini')
END
p_web.SSV('Kundenavn', g:KundeNavn)
!GETTING THEME FROM INI
GloTheme = GETINI('KundeProg','Theme_' & p_web.GSV('CommandA') ,'redmond', clip(path()) & '\KundeProg.ini')
p_web.SSV('theme', GloTheme )
ds_outputdebugstring('Webhandler Processlink - GloTheme: ' & CLIP(GloTheme))
ELSE
p_web.showInfo('ERROR IN PARAMETER.....')
ds_outputdebugstring('Webhandler Processlink - Path does not exist: ' & CLIP(GLO:DataSti) )
!AND SETS DEFAULT
p_web.SSV('CommandA', '1')
END
Webhandler - ParseRequestHeader:
!CALLING ONE OR THE OTHER - BUT SINCE THEY ARE CLEARED, NO CHANGETHEME HAPPENS:
!ds_outputdebugstring('In ParseRequestHeader - p_web.GSV(theme): ' & p_web.GSV('CommandA') & ' - ' & p_web.GSV('theme') )
!IF CLIP(p_web.GSV('theme')) <> ''
! self.ChangeTheme( p_web.GSV('theme') )
!END
ds_outputdebugstring('In ParseRequestHeader - GloTheme: ' & p_web.GSV('CommandA') & ' - ' & CLIP(GloTheme ))
IF CLIP(GloTheme) <> ''
self.ChangeTheme( CLIP(GloTheme ))
END